summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-01-20 08:02:59 -0700
committerBrian Paul <brianp@vmware.com>2010-01-20 08:18:33 -0700
commit05208b298d218071bae75a52a16e4483ca64c94d (patch)
treeb73bb254737a006148e9124bc94bf964178cbf1e /src
parent506e27b9724e7f11350fc2454d263bea2df8ea39 (diff)
mesa: replace questionable CPU_TO_LE32 macro with function
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/compiler.h15
1 files changed, 9 insertions, 6 deletions
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 <CoreFoundation/CFByteOrder.h>
#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 <sys/endian.h>
#define CPU_TO_LE32( x ) bswap32( x )