Fix: futex.h: include headers outside extern C
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 17 Aug 2022 20:41:47 +0000 (16:41 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 17 Aug 2022 20:48:47 +0000 (16:48 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ia8aac42e74d1d401cd893a30afb9cbde29a993d5

include/urcu/futex.h

index 753cf16d9e28d6c79639e915fd633175121c0315..e96b6e5fc5b2422e3ace466492ce1a73391f3870 100644 (file)
 #include <stdint.h>
 #include <time.h>
 
 #include <stdint.h>
 #include <time.h>
 
+#if (defined(__linux__) && defined(__NR_futex))
+
+/* For backwards compat */
+#define CONFIG_RCU_HAVE_FUTEX 1
+
+#include <unistd.h>
+#include <errno.h>
+#include <urcu/compiler.h>
+#include <urcu/arch.h>
+
+#elif defined(__FreeBSD__)
+
+#include <sys/types.h>
+#include <sys/umtx.h>
+
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -58,14 +75,6 @@ extern int compat_futex_async(int32_t *uaddr, int op, int32_t val,
 
 #if (defined(__linux__) && defined(__NR_futex))
 
 
 #if (defined(__linux__) && defined(__NR_futex))
 
-/* For backwards compat */
-#define CONFIG_RCU_HAVE_FUTEX 1
-
-#include <unistd.h>
-#include <errno.h>
-#include <urcu/compiler.h>
-#include <urcu/arch.h>
-
 static inline int futex(int32_t *uaddr, int op, int32_t val,
                const struct timespec *timeout, int32_t *uaddr2, int32_t val3)
 {
 static inline int futex(int32_t *uaddr, int op, int32_t val,
                const struct timespec *timeout, int32_t *uaddr2, int32_t val3)
 {
@@ -111,9 +120,6 @@ static inline int futex_async(int32_t *uaddr, int op, int32_t val,
 
 #elif defined(__FreeBSD__)
 
 
 #elif defined(__FreeBSD__)
 
-#include <sys/types.h>
-#include <sys/umtx.h>
-
 static inline int futex_async(int32_t *uaddr, int op, int32_t val,
                const struct timespec *timeout,
                int32_t *uaddr2 __attribute__((unused)),
 static inline int futex_async(int32_t *uaddr, int op, int32_t val,
                const struct timespec *timeout,
                int32_t *uaddr2 __attribute__((unused)),
This page took 0.026233 seconds and 4 git commands to generate.