Browse Source

port r14506 from 1.1: cygwin and mingw32 don't always have ffs, use gcc's instead

Samuel Thibault 10 years ago
parent
commit
ede08ed328
1 changed files with 6 additions and 2 deletions
  1. 6 2
      examples/pi/SobolQRNG/sobol_gold.c

+ 6 - 2
examples/pi/SobolQRNG/sobol_gold.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011, 2014  Université de Bordeaux
+ * Copyright (C) 2010-2011, 2014-2015  Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -62,9 +62,13 @@
 
 #define k_2powneg32 2.3283064E-10F
 
-#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+#if defined(_WIN32)
+#ifdef __GNUC__
+#define ffs(arg) __builtin_ffs(arg)
+#else
 #define ffs(arg) _bit_scan_forward(arg)
 #endif
+#endif
 
 /* Create the direction numbers, based on the primitive polynomials. */
 void initSobolDirectionVectors(int n_dimensions, unsigned int *directions)