diff options
author | marha <marha@users.sourceforge.net> | 2011-03-28 12:59:46 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-03-28 12:59:46 +0000 |
commit | 3015123fd2904d907896b1aefbe32c267baa2dc2 (patch) | |
tree | 3adc12a65779305c5fb676be577667ff7e33c389 /mesalib/src/mesa/main/compiler.h | |
parent | 0d9293f57738117231d77df831b6569d4f0739f2 (diff) | |
parent | 0b9b391c5a7acb31e5d8061169649043a38d6d0e (diff) | |
download | vcxsrv-3015123fd2904d907896b1aefbe32c267baa2dc2.tar.gz vcxsrv-3015123fd2904d907896b1aefbe32c267baa2dc2.tar.bz2 vcxsrv-3015123fd2904d907896b1aefbe32c267baa2dc2.zip |
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/main/compiler.h')
-rw-r--r-- | mesalib/src/mesa/main/compiler.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/mesalib/src/mesa/main/compiler.h b/mesalib/src/mesa/main/compiler.h index c1d773b18..f2b344fd1 100644 --- a/mesalib/src/mesa/main/compiler.h +++ b/mesalib/src/mesa/main/compiler.h @@ -149,12 +149,14 @@ extern "C" { * We also need to define a USED attribute, so the optimizer doesn't
* inline a static function that we later use in an alias. - ajax
*/
-#if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-# define PUBLIC __attribute__((visibility("default")))
-# define USED __attribute__((used))
-#else
-# define PUBLIC
-# define USED
+#ifndef PUBLIC
+# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define PUBLIC __attribute__((visibility("default")))
+# define USED __attribute__((used))
+# else
+# define PUBLIC
+# define USED
+# endif
#endif
@@ -173,15 +175,17 @@ extern "C" { * __builtin_expect macros
*/
#if !defined(__GNUC__)
-# define __builtin_expect(x, y) x
+# define __builtin_expect(x, y) (x)
#endif
-#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
+# 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)
+# endif
#endif
/**
|