summaryrefslogtreecommitdiff
path: root/multimedia/ringrtc/files/patch-abseil
blob: acb2cc758d4fc6797e7afd6094c60077f861c518 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
From b9707b7d7845f9710ae6d5906827b833fdcc2754 Mon Sep 17 00:00:00 2001
From: Derek Mauro <dmauro@google.com>
Date: Wed, 6 Sep 2023 13:30:04 -0700
Subject: [PATCH] Use native methods to implement absl::base_internal::GetPID()
 on FreeBSD, NetBSD, and OpenBSD

https://man.freebsd.org/cgi/man.cgi?query=pthread_getthreadid_np
https://man.netbsd.org/_lwp_self.2
https://man.openbsd.org/getthrid.2

This fixes a build break caused by
https://github.com/abseil/abseil-cpp/commit/88cc63ef739d83277b492e881be72e9069fcb1fe

Fixes #1518

PiperOrigin-RevId: 563200172
Change-Id: Ifd1b65c84e3631075248bc2e01b8f047dc72d201
---
 absl/base/internal/sysinfo.cc | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/absl/base/internal/sysinfo.cc b/absl/base/internal/sysinfo.cc
index 8bcc4fafaf9..5b427fa5e98 100644
--- src/webrtc/src/third_party/abseil-cpp/absl/base/internal/sysinfo.cc
+++ src/webrtc/src/third_party/abseil-cpp/absl/base/internal/sysinfo.cc
@@ -34,6 +34,14 @@
 #include <sys/sysctl.h>
 #endif
 
+#ifdef __FreeBSD__
+#include <pthread_np.h>
+#endif
+
+#ifdef __NetBSD__
+#include <lwp.h>
+#endif
+
 #if defined(__myriad2__)
 #include <rtems.h>
 #endif
@@ -421,7 +429,7 @@ pid_t GetTID() {
   return tid;
 }
 
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || defined(__FreeBSD__)
 
 pid_t GetTID() {
   uint64_t tid;
@@ -432,6 +440,14 @@ pid_t GetTID() {
   return static_cast<pid_t>(tid);
 }
 
+#elif defined(__OpenBSD__)
+
+pid_t GetTID() { return getthrid(); }
+
+#elif defined(__NetBSD__)
+
+pid_t GetTID() { return static_cast<pid_t>(_lwp_self()); }
+
 #elif defined(__native_client__)
 
 pid_t GetTID() {




From b020fe646186aa624e607a23baca445ba8cd199e Mon Sep 17 00:00:00 2001
From: Derek Mauro <dmauro@google.com>
Date: Thu, 7 Sep 2023 08:02:09 -0700
Subject: [PATCH] Fix GetTID() on FreeBSD

https://github.com/abseil/abseil-cpp/issues/1518#issuecomment-1709098904
pointed out that the previous untested fix doesn't work because
pthread_getthreadid_np() has a different signature on Darwin.

Follow up to https://github.com/abseil/abseil-cpp/commit/b9707b7d7845f9710ae6d5906827b833fdcc2754

Fixes #1518

PiperOrigin-RevId: 563432451
Change-Id: Id0a9212e9c4413fa520a42934efaed2a06ca5dbc
---
 absl/base/internal/sysinfo.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/absl/base/internal/sysinfo.cc b/absl/base/internal/sysinfo.cc
index 5b427fa5e98..79eaba3e51c 100644
--- src/webrtc/src/third_party/abseil-cpp/absl/base/internal/sysinfo.cc
+++ src/webrtc/src/third_party/abseil-cpp/absl/base/internal/sysinfo.cc
@@ -429,7 +429,7 @@ pid_t GetTID() {
   return tid;
 }
 
-#elif defined(__APPLE__) || defined(__FreeBSD__)
+#elif defined(__APPLE__)
 
 pid_t GetTID() {
   uint64_t tid;
@@ -440,6 +440,10 @@ pid_t GetTID() {
   return static_cast<pid_t>(tid);
 }
 
+#elif defined(__FreeBSD__)
+
+pid_t GetTID() { return static_cast<pid_t>(pthread_getthreadid_np()); }
+
 #elif defined(__OpenBSD__)
 
 pid_t GetTID() { return getthrid(); }