Add support for non-Linux GNU
GNU/Hurd and GNU/kFreeBSD have basically the same userland as GNU/Linux, just not the same kernel.
This commit is contained in:
parent
27e93ee86b
commit
9def8cf10d
@ -63,6 +63,12 @@ AS_CASE(["${host}"],
|
|||||||
OS_LDFLAGS="-lrt -lpthread"
|
OS_LDFLAGS="-lrt -lpthread"
|
||||||
HAVE_POSIX=1
|
HAVE_POSIX=1
|
||||||
],
|
],
|
||||||
|
[*-k*bsd-gnu* | *-*gnu*],
|
||||||
|
[
|
||||||
|
OS_CFLAGS="-DWEBRTC_GNU"
|
||||||
|
PLATFORM_CFLAGS="-DWEBRTC_POSIX"
|
||||||
|
HAVE_POSIX=1
|
||||||
|
],
|
||||||
[*-*darwin*],
|
[*-*darwin*],
|
||||||
[
|
[
|
||||||
OS_CFLAGS="-DWEBRTC_MAC -DWEBRTC_THREAD_RR -DWEBRTC_CLOCK_TYPE_REALTIME"
|
OS_CFLAGS="-DWEBRTC_MAC -DWEBRTC_THREAD_RR -DWEBRTC_CLOCK_TYPE_REALTIME"
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
#if defined(WEBRTC_LINUX)
|
#if defined(WEBRTC_LINUX)
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
|
#elif defined(WEBRTC_GNU)
|
||||||
|
#include <sys/syscall.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace rtc {
|
namespace rtc {
|
||||||
@ -32,6 +34,8 @@ PlatformThreadId CurrentThreadId() {
|
|||||||
ret = syscall(__NR_gettid);
|
ret = syscall(__NR_gettid);
|
||||||
#elif defined(WEBRTC_ANDROID)
|
#elif defined(WEBRTC_ANDROID)
|
||||||
ret = gettid();
|
ret = gettid();
|
||||||
|
#elif defined(WEBRTC_GNU)
|
||||||
|
ret = pthread_self();
|
||||||
#else
|
#else
|
||||||
// Default implementation for nacl and solaris.
|
// Default implementation for nacl and solaris.
|
||||||
ret = reinterpret_cast<pid_t>(pthread_self());
|
ret = reinterpret_cast<pid_t>(pthread_self());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user