Samuel Thibault 3 роки тому
батько
коміт
cc97ebeddb
1 змінених файлів з 9 додано та 0 видалено
  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;