From a7aaf052f935cb51b7b616a7a764c57fc01b2821 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 16 Jan 2010 20:21:35 -0800 Subject: Sun compilers now support some gcc __attribute__ values Sun cc 5.9 and later (__SUNPRO_C >= 0x590) support __attribute__ calls for aligned, always_inline, noinline, pure, const, and malloc. This commit includes updates to files that were regenerated by gl_XML.py after adding the __SUNPRO_C checks to it Signed-off-by: Alan Coopersmith Signed-off-by: Brian Paul --- src/mesa/main/compiler.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa/main/compiler.h') diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 4eb249b4af..9eab1ead24 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -173,7 +173,8 @@ 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__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ + || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PUBLIC __attribute__((visibility("default"))) # define USED __attribute__((used)) #else -- cgit v1.2.3 From 05208b298d218071bae75a52a16e4483ca64c94d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 20 Jan 2010 08:02:59 -0700 Subject: mesa: replace questionable CPU_TO_LE32 macro with function --- src/mesa/main/compiler.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/mesa/main/compiler.h') diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 9eab1ead24..9cef99f67a 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -223,8 +223,8 @@ extern "C" { /** - * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN. - * Do not use them unless absolutely necessary! + * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN, and CPU_TO_LE32. + * Do not use these unless absolutely necessary! * Try to use a runtime test instead. * For now, only used by some DRI hardware drivers for color/texel packing. */ @@ -236,10 +236,13 @@ extern "C" { #include #define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) #elif (defined(_AIX) || defined(__blrts)) -#define CPU_TO_LE32( x ) x = ((x & 0x000000ff) << 24) | \ - ((x & 0x0000ff00) << 8) | \ - ((x & 0x00ff0000) >> 8) | \ - ((x & 0xff000000) >> 24); +static INLINE GLuint CPU_TO_LE32(GLuint x) +{ + return (((x & 0x000000ff) << 24) | + ((x & 0x0000ff00) << 8) | + ((x & 0x00ff0000) >> 8) | + ((x & 0xff000000) >> 24)); +} #else /*__linux__ */ #include #define CPU_TO_LE32( x ) bswap32( x ) -- cgit v1.2.3