#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
#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)
{
#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)),