util: enable futex usage on BSDs after 7dc2f4788288
[mesa.git] / src / util / futex.h
index cf8dd0206c98fdb04ed2e00abe348be163f4d4fa..4d712e2ef2dea91fee9de9b9a125f8e21f2ea38c 100644 (file)
@@ -25,6 +25,7 @@
 #define UTIL_FUTEX_H
 
 #if defined(HAVE_LINUX_FUTEX_H)
+#define UTIL_FUTEX_SUPPORTED 1
 
 #include <limits.h>
 #include <stdint.h>
@@ -52,6 +53,7 @@ static inline int futex_wait(uint32_t *addr, int32_t value, const struct timespe
 }
 
 #elif defined(__FreeBSD__)
+#define UTIL_FUTEX_SUPPORTED 1
 
 #include <assert.h>
 #include <errno.h>
@@ -86,6 +88,7 @@ static inline int futex_wait(uint32_t *addr, int32_t value, struct timespec *tim
 }
 
 #elif defined(__OpenBSD__)
+#define UTIL_FUTEX_SUPPORTED 1
 
 #include <sys/time.h>
 #include <sys/futex.h>
@@ -103,6 +106,8 @@ static inline int futex_wait(uint32_t *addr, int32_t value, const struct timespe
    return futex(addr, FUTEX_WAIT, value, &tsrel, NULL);
 }
 
+#else
+#define UTIL_FUTEX_SUPPORTED 0
 #endif
 
 #endif /* UTIL_FUTEX_H */