Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rtc_base: define PlatformThread{Id,Ref} on OpenBSD
pthread_self(3) returns a phtread_t (aka. pthread *) value. With @ilya-fedin: Redefine thread IDs as `intptr_t` on POSIX platforms unless platform specific functions/types exist so as to avoid the following warning on OpenBSD/amd64 7.0 using clang 11.1.0: ``` platform_thread_types.cc:57:10: error: cast from pointer to smaller type 'rtc::PlatformThreadId' (aka 'int') loses information return reinterpret_cast<PlatformThreadId>(pthread_self()); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` At least Solaris defines `pid_t` as `long`, i.e. that warning would not occur. OpenBSD defines `pid_t` as `int`. Linux uses its non-portable gettid(3) returing a `pid_t` value, so stick with that.
- Loading branch information