From: Mathieu Desnoyers Date: Wed, 17 Aug 2022 20:41:47 +0000 (-0400) Subject: Fix: futex.h: include headers outside extern C X-Git-Tag: v0.14.0~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d428afc44ee5aa598c8033939ae1c1ac806f1a15;p=userspace-rcu.git Fix: futex.h: include headers outside extern C Signed-off-by: Mathieu Desnoyers Change-Id: Ia8aac42e74d1d401cd893a30afb9cbde29a993d5 --- 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)),