Bug 1326011 - Unbreak build on BSDs after after bug 1250356. r=jesup
authorJan Beich <jbeich@FreeBSD.org>
Wed, 28 Dec 2016 00:57:00 +0100
changeset 327531 b8ab1963da32b70db46b697fb858914569ff30a5
parent 327530 47ead489b52ecfce54ee25886e17754d12696132
child 327532 db38dbe32679ad449fecadf6e5f8501d6a0d7234
push id35517
push userkwierso@gmail.com
push dateThu, 29 Dec 2016 20:22:54 +0000
treeherderautoland@3f2f8d77ad27 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1326011, 1250356
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1326011 - Unbreak build on BSDs after after bug 1250356. r=jesup MozReview-Commit-ID: 390dsKqlJQe
media/webrtc/trunk/webrtc/base/basictypes.h
media/webrtc/trunk/webrtc/base/platform_thread.cc
media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi
--- a/media/webrtc/trunk/webrtc/base/basictypes.h
+++ b/media/webrtc/trunk/webrtc/base/basictypes.h
@@ -6,16 +6,17 @@
  *  tree. An additional intellectual property rights grant can be found
  *  in the file PATENTS.  All contributing project authors may
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
 #ifndef WEBRTC_BASE_BASICTYPES_H_
 #define WEBRTC_BASE_BASICTYPES_H_
 
+#include <sys/types.h> // for pid_t
 #include <stddef.h>  // for NULL, size_t
 #include <stdint.h>  // for uintptr_t and (u)int_t types.
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"  // NOLINT
 #endif
 
 // Detect compiler is for x86 or x64.
--- a/media/webrtc/trunk/webrtc/base/platform_thread.cc
+++ b/media/webrtc/trunk/webrtc/base/platform_thread.cc
@@ -12,16 +12,22 @@
 
 #include "webrtc/base/checks.h"
 
 #if defined(WEBRTC_LINUX)
 #include <sys/prctl.h>
 #include <sys/syscall.h>
 #endif
 
+#if defined(__NetBSD__)
+#include <lwp.h>
+#elif defined(__FreeBSD__)
+#include <pthread_np.h>
+#endif
+
 namespace rtc {
 
 #if defined(WEBRTC_WIN)
 // For use in ThreadWindowsUI callbacks
 static UINT static_reg_windows_msg = RegisterWindowMessageW(L"WebrtcWindowsUIThreadEvent");
 // timer id used in delayed callbacks
 static const UINT_PTR kTimerId = 1;
 static const wchar_t kThisProperty[] = L"ThreadWindowsUIPtr";
@@ -34,16 +40,24 @@ PlatformThreadId CurrentThreadId() {
   ret = GetCurrentThreadId();
 #elif defined(WEBRTC_POSIX)
 #if defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
   ret = pthread_mach_thread_np(pthread_self());
 #elif defined(WEBRTC_LINUX)
   ret =  syscall(__NR_gettid);
 #elif defined(WEBRTC_ANDROID)
   ret = gettid();
+#elif defined(__NetBSD__)
+  ret = _lwp_self();
+#elif defined(__DragonFly__)
+  ret = lwp_gettid();
+#elif defined(__OpenBSD__)
+  ret = reinterpret_cast<uintptr_t> (pthread_self());
+#elif defined(__FreeBSD__)
+  ret = pthread_getthreadid_np();
 #else
   // Default implementation for nacl and solaris.
   ret = reinterpret_cast<pid_t>(pthread_self());
 #endif
 #endif  // defined(WEBRTC_POSIX)
   RTC_DCHECK(ret);
   return ret;
 }
--- a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi
+++ b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi
@@ -133,23 +133,19 @@
               'link_settings': {
                 'libraries': [
                   '-llog',
                   '-lOpenSLES',
                 ],
               },
             }],
             ['OS=="linux"', {
-              'sources': [
-                'linux/latebindingsymboltable_linux.cc',
-                'linux/latebindingsymboltable_linux.h',
-              ],
               'link_settings': {
                 'libraries': [
-                  '-ldl','-lX11',
+                  '-ldl',
                 ],
               },
             }],
             ['include_sndio_audio==1', {
               'link_settings': {
                 'libraries': [
                   '-lsndio',
                 ],
@@ -163,37 +159,51 @@
             }],
             ['include_alsa_audio==1', {
               'cflags_mozilla': [
                 '$(MOZ_ALSA_CFLAGS)',
               ],
               'defines': [
                 'LINUX_ALSA',
               ],
+              'link_settings': {
+                'libraries': [
+                  '-lX11',
+                ],
+              },
               'sources': [
                 'linux/alsasymboltable_linux.cc',
                 'linux/alsasymboltable_linux.h',
                 'linux/audio_device_alsa_linux.cc',
                 'linux/audio_device_alsa_linux.h',
                 'linux/audio_mixer_manager_alsa_linux.cc',
                 'linux/audio_mixer_manager_alsa_linux.h',
+                'linux/latebindingsymboltable_linux.cc',
+                'linux/latebindingsymboltable_linux.h',
               ],
             }],
             ['include_pulse_audio==1', {
               'cflags_mozilla': [
                 '$(MOZ_PULSEAUDIO_CFLAGS)',
               ],
               'defines': [
                 'LINUX_PULSE',
               ],
+              'link_settings': {
+                'libraries': [
+                  '-lX11',
+                ],
+              },
               'sources': [
                 'linux/audio_device_pulse_linux.cc',
                 'linux/audio_device_pulse_linux.h',
                 'linux/audio_mixer_manager_pulse_linux.cc',
                 'linux/audio_mixer_manager_pulse_linux.h',
+                'linux/latebindingsymboltable_linux.cc',
+                'linux/latebindingsymboltable_linux.h',
                 'linux/pulseaudiosymboltable_linux.cc',
                 'linux/pulseaudiosymboltable_linux.h',
               ],
             }],
             ['OS=="mac"', {
               'sources': [
                 'mac/audio_device_mac.cc',
                 'mac/audio_device_mac.h',