[libc++] Define _LIBCPP_NO_NATIVE_SEMAPHORES even outside of pthread
authorLouis Dionne <ldionne.2@gmail.com>
Thu, 3 Jun 2021 22:18:41 +0000 (18:18 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Thu, 3 Jun 2021 22:18:42 +0000 (18:18 -0400)
<semaphore> needs to know about whether native semaphores are supported
or not, even if we're not using the pthread API.

libcxx/include/__threading_support

index 788cae8..4d86716 100644 (file)
 # include <__external_threading>
 #elif !defined(_LIBCPP_HAS_NO_THREADS)
 
+#if defined(__APPLE__) || defined(__MVS__)
+# define _LIBCPP_NO_NATIVE_SEMAPHORES
+#endif
+
 #if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
 # include <pthread.h>
 # include <sched.h>
-# if defined(__APPLE__) || defined(__MVS__)
-#  define _LIBCPP_NO_NATIVE_SEMAPHORES
-# endif
 # ifndef _LIBCPP_NO_NATIVE_SEMAPHORES
-# include <semaphore.h>
+#   include <semaphore.h>
 # endif
 #elif defined(_LIBCPP_HAS_THREAD_API_C11)
 # include <threads.h>