Mesa (mesa_7_6_branch): mesa: define 32bit byteswap for AIX.

Brian Paul brianp at kemper.freedesktop.org
Thu Nov 19 08:28:30 PST 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 4e6e2462ea1fb5b7fc24bb0e707a9cf6507c47c9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4e6e2462ea1fb5b7fc24bb0e707a9cf6507c47c9

Author: Tom Fogal <tfogal at alumni.unh.edu>
Date:   Thu Nov 19 09:18:48 2009 -0700

mesa: define 32bit byteswap for AIX.

Fixes `xlib' driver build on AIX.

Signed-off-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/compiler.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
index 9319505..522295a 100644
--- a/src/mesa/main/compiler.h
+++ b/src/mesa/main/compiler.h
@@ -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__*/



More information about the mesa-commit mailing list