blob: 21d37687f44ed87fd0eb15b3a9ad3c5d5e14dfce (
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
|
https://bugs.gentoo.org/898866
From: Brahmajit Das <brahmajit.xyz@gmail.com>
Date: Sat, 17 Jun 2023 15:32:10 +0000
Subject: [PATCH 1/1] Fix building against musl C library
PTHREAD_RWLOCK_PREFER_WRITER_NP isn't available in musl libc/non-glibc
systems. Checking for only __linux__ being defined isn't enough,
additional check of __GLIBC__ being defined is needed.
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
--- a/lib/FXReadWriteLock.cpp
+++ b/lib/FXReadWriteLock.cpp
@@ -80,7 +80,7 @@ FXReadWriteLock::FXReadWriteLock(){
FXASSERT(sizeof(data)>=sizeof(pthread_rwlock_t));
pthread_rwlockattr_t rwlockatt;
pthread_rwlockattr_init(&rwlockatt);
-#if defined(__linux__)
+#if defined(__linux__) && defined(__GLIBC__)
pthread_rwlockattr_setkind_np(&rwlockatt,PTHREAD_RWLOCK_PREFER_WRITER_NP);
#endif
pthread_rwlock_init((pthread_rwlock_t*)data,&rwlockatt);
--
2.41.0
|