Replace syscall(SYS_futex,) by futex().

Index: test/other/testMutex.cpp
--- test/other/testMutex.cpp.orig
+++ test/other/testMutex.cpp
@@ -11,7 +11,9 @@
 #include <cstdint>
 #include <functional>
 
-#ifndef _WIN32
+#if defined(__OpenBSD__)
+	#include <sys/futex.h>
+#elif !defined(_WIN32)
 	#include <sys/syscall.h>
 	#include <linux/futex.h>
 #endif
@@ -25,34 +27,52 @@
 InitSpringTime ist;
 
 #ifndef _WIN32
-	typedef uint32_t futex;
+	typedef uint32_t lock;
 
-	static void futex_init(futex* m)
+	static void futex_init(lock* m)
 	{
 		*m = 0;
 	}
 
-	static void futex_destroy(futex* m)
+	static void futex_destroy(lock* m)
 	{
 		*m = 0;
 	}
 
-	static void futex_lock(futex* m)
+	static void futex_wait(lock* m, int value)
 	{
-		futex c;
+	#ifdef __OpenBSD__
+		futex(m, FUTEX_WAIT_PRIVATE, value, NULL, NULL);
+	#else
+		syscall(SYS_futex, m, FUTEX_WAIT_PRIVATE, value, NULL, NULL, 0);
+	#endif
+	}
+
+	static void futex_wake(lock* m, int count)
+	{
+	#ifdef __OpenBSD__
+		futex(m, FUTEX_WAKE_PRIVATE, count, NULL, NULL);
+	#else
+		syscall(SYS_futex, m, FUTEX_WAKE_PRIVATE, count, NULL, NULL, 0);
+	#endif
+	}
+
+	static void futex_lock(lock* m)
+	{
+		lock c;
 		if ((c = __sync_val_compare_and_swap(m, 0, 1)) != 0)  {
 			do {
 				if ((c == 2) || __sync_val_compare_and_swap(m, 1, 2) != 0)
-					syscall(SYS_futex, m, FUTEX_WAIT_PRIVATE, 2, NULL, NULL, 0);
+					futex_wait(m, 2);
 			} while((c = __sync_val_compare_and_swap(m, 0, 2)) != 0);
 		}
 	}
 
-	static void futex_unlock(futex* m)
+	static void futex_unlock(lock* m)
 	{
 		if (__sync_fetch_and_sub(m, 1) != 1) {
 			*m = 0;
-			syscall(SYS_futex, m, FUTEX_WAKE_PRIVATE, 1, NULL, NULL, 0);
+			futex_wake(m, 1);
 		}
 	}
 #endif
@@ -97,7 +117,7 @@ TEST_CASE("Mutex")
 #endif
 
 #ifndef _WIN32
-	futex ftx;
+	lock ftx;
 	futex_init(&ftx);
 	spring_time tCrit = Test("futex", [&]{ futex_lock(&ftx); }, [&]{ futex_unlock(&ftx); });
 	futex_init(&ftx);
