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:50:07 +0000 (16:50 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ia8aac42e74d1d401cd893a30afb9cbde29a993d5

include/urcu/futex.h

index e89d319089fb894b1455b7d4cbaebf0888d76c32..576d612a43c64524d4b50c910b1befcb97562f1c 100644 (file)
 #include <stdint.h>
 #include <time.h>
 
+#ifdef CONFIG_RCU_HAVE_FUTEX
+
+#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
@@ -56,11 +70,6 @@ extern int compat_futex_async(int32_t *uaddr, int op, int32_t val,
 
 #ifdef CONFIG_RCU_HAVE_FUTEX
 
-#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)
 {
@@ -106,9 +115,6 @@ static inline int futex_async(int32_t *uaddr, int op, int32_t val,
 
 #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)),
This page took 0.025886 seconds and 4 git commands to generate.