From 5858abec6efd01d6d190d9116ff803c096bc279b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 25 Mar 2011 11:37:24 +0000 Subject: [PATCH] gallium: Avoid redefinition of likely/unlikely macros on non gcc compilers. --- src/gallium/include/pipe/p_compiler.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index 3441db6..8c788f4 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -292,12 +292,14 @@ void _ReadWriteBarrier(void); * Note that profile guided optimization can offer better results, but * needs an appropriate coverage suite and does not inform human readers. */ -#ifdef __GNUC__ -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else -#define likely(x) !!(x) -#define unlikely(x) !!(x) +#ifndef likely +# if defined(__GNUC__) +# define likely(x) __builtin_expect(!!(x), 1) +# define unlikely(x) __builtin_expect(!!(x), 0) +# else +# define likely(x) (x) +# define unlikely(x) (x) +# endif #endif -- 2.7.4