Check for __linux__ before including syscall.h
[urcu.git] / urcu / static / urcu.h
index 3161a40088836c92a65edbdc8445385913afe0bb..5ba3004ddb17ccef50f69be9925ed8181923d65b 100644 (file)
@@ -31,8 +31,8 @@
 
 #include <stdlib.h>
 #include <pthread.h>
-#include <syscall.h>
 #include <unistd.h>
+#include <stdint.h>
 
 #include <urcu/compiler.h>
 #include <urcu/arch.h>
 extern "C" {
 #endif 
 
-/* Default is RCU_MEMBARRIER */
+/* Default is RCU_MEMBARRIER on linux */
 #if !defined(RCU_MEMBARRIER) && !defined(RCU_MB) && !defined(RCU_SIGNAL)
-#define RCU_MEMBARRIER
+# ifdef __linux__
+# define RCU_MEMBARRIER
+# else
+# define RCU_MB
+# endif
 #endif
 
 #ifdef RCU_MEMBARRIER
-#include <unistd.h>
-#include <sys/syscall.h>
+#include <syscall.h>
 
 /* If the headers do not support SYS_membarrier, statically use RCU_MB */
 #ifdef SYS_membarrier
@@ -228,7 +231,7 @@ struct rcu_reader {
 
 extern struct rcu_reader __thread rcu_reader;
 
-extern int gp_futex;
+extern int32_t gp_futex;
 
 /*
  * Wake-up waiting synchronize_rcu(). Called from many concurrent threads.
This page took 0.02374 seconds and 4 git commands to generate.