Browse Source

Fix windows build

Samuel Thibault 3 years ago
parent
commit
cc97ebeddb
1 changed files with 9 additions and 0 deletions
  1. 9 0
      src/core/workers.c

+ 9 - 0
src/core/workers.c

@@ -20,6 +20,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <strings.h>
 #ifdef __linux__
 #include <sys/utsname.h>
 #endif
@@ -56,6 +57,14 @@
 #include <windows.h>
 #endif
 
+#if defined(_WIN32)
+#ifdef __GNUC__
+#define ffs(arg) __builtin_ffs(arg)
+#else
+#define ffs(arg) _bit_scan_forward(arg)
+#endif
+#endif
+
 
 /* global knobs */
 static int __g_calibrate_knob;