gentoo-ebuilds/x11-libs/fox/files/fox-1.7.84-pthread_rwlock_prefer_writer_np-musl.patch
Sam James b1fae4949d
x11-libs/fox: add 1.7.84
Bug: https://bugs.gentoo.org/864412
Closes: https://bugs.gentoo.org/832299
Signed-off-by: Sam James <sam@gentoo.org>
2023-10-01 09:37:34 +01:00

20 lines
937 B
Diff

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. 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
@@ -62,7 +62,7 @@ FXReadWriteLock::FXReadWriteLock(){
InitializeCriticalSection(((RWLOCK*)data)->mutex);
InitializeCriticalSection(((RWLOCK*)data)->access);
((RWLOCK*)data)->readers=0;
-#elif (_XOPEN_SOURCE >= 500) || (_POSIX_C_SOURCE >= 200809L)
+#elif (_XOPEN_SOURCE >= 500) || (_POSIX_C_SOURCE >= 200809L) && defined(__GLIBC__)
// If this fails on your machine, determine what value
// of sizeof(pthread_rwlock_t) is supposed to be on your
// machine and mail it to: jeroen@fox-toolkit.net!!