ソースを参照

Fix windows build

Samuel Thibault 4 年 前
コミット
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;