summaryrefslogtreecommitdiff
path: root/media-libs/mesa-amber/files/mesa-amber-21.3.9-glibc-2.43.patch
blob: 7247c0baf8f9996720aff4d8c7b44c91d9365ebc (plain)
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
Backport fixes for glibc 2.43 from newer mesa.

https://bugs.gentoo.org/969493

--- a/include/c11/threads_posix.h
+++ b/include/c11/threads_posix.h
@@ -51,8 +51,10 @@
 #include <pthread.h>
 
 /*---------------------------- macros ----------------------------*/
-#define ONCE_FLAG_INIT PTHREAD_ONCE_INIT
-#ifdef INIT_ONCE_STATIC_INIT
+#ifndef __once_flag_defined
+#  define ONCE_FLAG_INIT PTHREAD_ONCE_INIT
+#endif
+#ifdef PTHREAD_DESTRUCTOR_ITERATIONS
 #define TSS_DTOR_ITERATIONS PTHREAD_DESTRUCTOR_ITERATIONS
 #else
 #define TSS_DTOR_ITERATIONS 1  // assume TSS dtor MAY be called at least once.
@@ -66,7 +68,9 @@
 typedef pthread_t       thrd_t;
 typedef pthread_key_t   tss_t;
 typedef pthread_mutex_t mtx_t;
+#ifndef __once_flag_defined
 typedef pthread_once_t  once_flag;
+#endif
 
 
 /*
@@ -90,11 +94,13 @@
 
 /*--------------- 7.25.2 Initialization functions ---------------*/
 // 7.25.2.1
+#ifndef __once_flag_defined
 static inline void
 call_once(once_flag *flag, void (*func)(void))
 {
     pthread_once(flag, func);
 }
+#endif
 
 
 /*------------- 7.25.3 Condition variable functions -------------*/