diff --git a/rtc_base/platform_thread_types.cc b/rtc_base/platform_thread_types.cc index 15d48618bd..67bb0542e9 100644 --- a/rtc_base/platform_thread_types.cc +++ b/rtc_base/platform_thread_types.cc @@ -29,9 +29,11 @@ PlatformThreadId CurrentThreadId() { return zx_thread_self(); #elif defined(WEBRTC_LINUX) return syscall(__NR_gettid); +#elif defined(__EMSCRIPTEN__) + return static_cast(pthread_self()); #else // Default implementation for nacl and solaris. - return reinterpret_cast(pthread_self()); + return reinterpret_cast(pthread_self()); #endif #endif // defined(WEBRTC_POSIX) } diff --git a/rtc_base/system/arch.h b/rtc_base/system/arch.h index f07796bb52..eb77ffa8f4 100644 --- a/rtc_base/system/arch.h +++ b/rtc_base/system/arch.h @@ -47,6 +47,9 @@ #elif defined(__pnacl__) #define WEBRTC_ARCH_32_BITS #define WEBRTC_ARCH_LITTLE_ENDIAN +#elif defined(__EMSCRIPTEN__) +#define WEBRTC_ARCH_32_BITS +#define WEBRTC_ARCH_LITTLE_ENDIAN #else #error Please add support for your architecture in rtc_base/system/arch.h #endif