Updated CPU_TO_LE32 to work on darwin
authorJeremy Huddleston <jeremy@yuffie.local>
Tue, 31 Mar 2009 22:08:49 +0000 (15:08 -0700)
committerJeremy Huddleston <jeremy@yuffie.local>
Tue, 31 Mar 2009 22:08:49 +0000 (15:08 -0700)
src/mesa/main/compiler.h

index 39b19bb776766f831f119de21ffe5469fdc02e72..93103fe878dc68074db2751e9ee579eb5de9eeab 100644 (file)
@@ -230,7 +230,10 @@ extern "C" {
 #if defined(__linux__)
 #include <byteswap.h>
 #define CPU_TO_LE32( x )       bswap_32( x )
-#else /*__linux__*/
+#elif defined(__APPLE__)
+#include <CoreFoundation/CFByteOrder.h>
+#define CPU_TO_LE32( x )       CFSwapInt32HostToLittle( x )
+#else /*__linux__ __APPLE__*/
 #include <sys/endian.h>
 #define CPU_TO_LE32( x )       bswap32( x )
 #endif /*__linux__*/