diff options
author | Svante Signell <svante.signell@gmail.com> | 2019-08-31 22:59:33 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-08-31 23:00:29 +0200 |
commit | 9def8cf10d3c97640d32f1328535e881288f700f (patch) | |
tree | d115c12532390f935c868049f20943598b44a8f7 | |
parent | 27e93ee86b5ad07ff058236d9dab196b95d1e463 (diff) |
Add support for non-Linux GNU
GNU/Hurd and GNU/kFreeBSD have basically the same userland as GNU/Linux,
just not the same kernel.
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | webrtc/base/platform_thread.cc | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index a687e4d..7973ead 100644 --- a/configure.ac +++ b/configure.ac @@ -63,6 +63,12 @@ AS_CASE(["${host}"], OS_LDFLAGS="-lrt -lpthread" HAVE_POSIX=1 ], + [*-k*bsd-gnu* | *-*gnu*], + [ + OS_CFLAGS="-DWEBRTC_GNU" + PLATFORM_CFLAGS="-DWEBRTC_POSIX" + HAVE_POSIX=1 + ], [*-*darwin*], [ OS_CFLAGS="-DWEBRTC_MAC -DWEBRTC_THREAD_RR -DWEBRTC_CLOCK_TYPE_REALTIME" diff --git a/webrtc/base/platform_thread.cc b/webrtc/base/platform_thread.cc index 4167392..707ccf8 100644 --- a/webrtc/base/platform_thread.cc +++ b/webrtc/base/platform_thread.cc @@ -17,6 +17,8 @@ #if defined(WEBRTC_LINUX) #include <sys/prctl.h> #include <sys/syscall.h> +#elif defined(WEBRTC_GNU) +#include <sys/syscall.h> #endif namespace rtc { @@ -32,6 +34,8 @@ PlatformThreadId CurrentThreadId() { ret = syscall(__NR_gettid); #elif defined(WEBRTC_ANDROID) ret = gettid(); +#elif defined(WEBRTC_GNU) + ret = pthread_self(); #else // Default implementation for nacl and solaris. ret = reinterpret_cast<pid_t>(pthread_self()); |