From 1310a0c1eb7b503190985e774a371a323b060d4c Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 15 Oct 2024 08:46:32 +0300 Subject: [PATCH] Intercept GC_pthread_sigmask on Cosmo Issue #666 (bdwgc). This symbol is intercepted now, to match that on Linux. * include/gc/gc_pthread_redirects.h [!GC_PTHREAD_REDIRECTS_ONLY && !GC_NO_PTHREAD_SIGMASK && __COSMOPOLITAN__] (GC_pthread_sigmask): Declare. * include/gc/gc_pthread_redirects.h [!GC_PTHREAD_REDIRECTS_ONLY && !GC_NO_PTHREAD_SIGMASK && !(GC_PTHREAD_SIGMASK_NEEDED || GC_HAVE_PTHREAD_SIGMASK || _BSD_SOURCE || _GNU_SOURCE || _NETBSD_SOURCE || _POSIX_C_SOURCE>=199506L || _XOPEN_SOURCE>=500)] (GC_NO_PTHREAD_SIGMASK): Do not define if __COSMOPOLITAN__. --- include/gc/gc_pthread_redirects.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/gc/gc_pthread_redirects.h b/include/gc/gc_pthread_redirects.h index 884d42d9b..5d1a691ab 100644 --- a/include/gc/gc_pthread_redirects.h +++ b/include/gc/gc_pthread_redirects.h @@ -56,11 +56,12 @@ GC_API void *GC_dlopen(const char * /* path */, int /* mode */); # endif /* !GC_NO_DLOPEN */ # ifndef GC_NO_PTHREAD_SIGMASK -# if defined(GC_PTHREAD_SIGMASK_NEEDED) \ - || defined(GC_HAVE_PTHREAD_SIGMASK) || defined(_BSD_SOURCE) \ - || defined(_GNU_SOURCE) || defined(_NETBSD_SOURCE) \ - || (_POSIX_C_SOURCE >= 199506L) || (_XOPEN_SOURCE >= 500) \ +# if defined(GC_PTHREAD_SIGMASK_NEEDED) || defined(__COSMOPOLITAN__) \ + || defined(GC_HAVE_PTHREAD_SIGMASK) || defined(_BSD_SOURCE) \ + || defined(_GNU_SOURCE) || defined(_NETBSD_SOURCE) \ + || (_POSIX_C_SOURCE >= 199506L) || (_XOPEN_SOURCE >= 500) \ || (__POSIX_VISIBLE >= 199506) /* xBSD internal macro */ + GC_API int GC_pthread_sigmask(int /* how */, const sigset_t *, sigset_t * /* oset */); # else