summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/imports.h
diff options
context:
space:
mode:
authorMatthieu Herrb <[email protected]>2010-04-19 09:32:37 -0600
committerBrian Paul <[email protected]>2010-04-19 09:33:53 -0600
commitcf7d08b4434325220488d4c9e871e230bafd7b7c (patch)
tree31e2a3a0dfc256dd418c21da937abfd0980b91b7 /src/mesa/main/imports.h
parentf4553d99c63e4bcb4d023c9e33b72fedd0dfbdc1 (diff)
mesa: Fix build with gcc 3.3.
Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/imports.h')
-rw-r--r--src/mesa/main/imports.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index d28f4ad125d..1c263aabca1 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -404,7 +404,8 @@ _mesa_is_pow_two(int x)
static INLINE int32_t
_mesa_next_pow_two_32(uint32_t x)
{
-#ifdef __GNUC__
+#if defined(__GNUC__) && \
+ ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
uint32_t y = (x != 1);
return (1 + y) << ((__builtin_clz(x - y) ^ 31) );
#else
@@ -422,7 +423,8 @@ _mesa_next_pow_two_32(uint32_t x)
static INLINE int64_t
_mesa_next_pow_two_64(uint64_t x)
{
-#ifdef __GNUC__
+#if defined(__GNUC__) && \
+ ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
uint64_t y = (x != 1);
if (sizeof(x) == sizeof(long))
return (1 + y) << ((__builtin_clzl(x - y) ^ 63));