mesa: define 32bit byteswap for AIX.
authorTom Fogal <tfogal@alumni.unh.edu>
Thu, 19 Nov 2009 16:18:48 +0000 (09:18 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 19 Nov 2009 16:18:51 +0000 (09:18 -0700)
Fixes `xlib' driver build on AIX.

Signed-off-by: Brian Paul <brianp@vmware.com>
src/mesa/main/compiler.h

index 9319505a75d32ff499d73e24403829062185486c..522295a9bfebe52ba86962dda5473503e46a0cfe 100644 (file)
@@ -235,7 +235,12 @@ extern "C" {
 #elif defined(__APPLE__)
 #include <CoreFoundation/CFByteOrder.h>
 #define CPU_TO_LE32( x )       CFSwapInt32HostToLittle( x )
-#else /*__linux__ __APPLE__*/
+#elif defined(_AIX)
+#define CPU_TO_LE32( x )        x = ((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 )
 #endif /*__linux__*/