summaryrefslogtreecommitdiff
path: root/devel/android-tools-adb-devel/files/patch-base_logging.cpp
blob: a59e7eef0ae0b1aceec51861b9992e1317a7aec1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- base/logging.cpp.orig	2015-12-14 21:12:52 UTC
+++ base/logging.cpp
@@ -66,6 +68,14 @@
 #include <unistd.h>
 #elif defined(_WIN32)
 #include <windows.h>
+#elif defined(__DragonFly__)
+#include <unistd.h>
+#elif defined(__FreeBSD__)
+#include <pthread_np.h>
+#elif defined(__NetBSD__)
+#include <lwp.h>
+#else
+#include <stdint.h>
 #endif
 
 static pid_t GetThreadId() {
@@ -77,6 +89,14 @@ static pid_t GetThreadId() {
   return syscall(__NR_gettid);
 #elif defined(_WIN32)
   return GetCurrentThreadId();
+#elif defined(__DragonFly__)
+  return lwp_gettid();
+#elif defined(__NetBSD__)
+  return _lwp_self();
+#elif defined(__FreeBSD__)
+  return pthread_getthreadid_np();
+#else
+  return (intptr_t) pthread_self();
 #endif
 }