Explorar o código

Only use __builtin_expect with GCC. Thanks to Jonathan Adamczewski for
reporting this issue!

Cédric Augonnet %!s(int64=14) %!d(string=hai) anos
pai
achega
7a076ccf58
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      include/starpu_util.h

+ 4 - 2
include/starpu_util.h

@@ -46,12 +46,14 @@ extern "C" {
 
 #define STARPU_ABORT()		abort()
 
-#define STARPU_UNLIKELY(expr)          (__builtin_expect(!!(expr),0))
-#define STARPU_LIKELY(expr)            (__builtin_expect(!!(expr),1))
 
 #ifdef __GNUC__
+#  define STARPU_UNLIKELY(expr)          (__builtin_expect(!!(expr),0))
+#  define STARPU_LIKELY(expr)            (__builtin_expect(!!(expr),1))
 #  define STARPU_ATTRIBUTE_UNUSED                  __attribute__((unused))
 #else
+#  define STARPU_UNLIKELY(expr)          (expr)
+#  define STARPU_LIKELY(expr)            (expr)
 #  define STARPU_ATTRIBUTE_UNUSED                  
 #endif