From d428afc44ee5aa598c8033939ae1c1ac806f1a15 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 17 Aug 2022 16:41:47 -0400 Subject: [PATCH] Fix: futex.h: include headers outside extern C Signed-off-by: Mathieu Desnoyers Change-Id: Ia8aac42e74d1d401cd893a30afb9cbde29a993d5 --- include/urcu/futex.h | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/include/urcu/futex.h b/include/urcu/futex.h index 753cf16..e96b6e5 100644 --- a/include/urcu/futex.h +++ b/include/urcu/futex.h @@ -30,6 +30,23 @@ #include #include +#if (defined(__linux__) && defined(__NR_futex)) + +/* For backwards compat */ +#define CONFIG_RCU_HAVE_FUTEX 1 + +#include +#include +#include +#include + +#elif defined(__FreeBSD__) + +#include +#include + +#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)) -/* For backwards compat */ -#define CONFIG_RCU_HAVE_FUTEX 1 - -#include -#include -#include -#include - 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__) -#include -#include - static inline int futex_async(int32_t *uaddr, int op, int32_t val, const struct timespec *timeout, int32_t *uaddr2 __attribute__((unused)), -- 2.34.1