summaryrefslogtreecommitdiff
path: root/lib/mesa/src
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-02-19 04:57:03 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-02-19 04:57:03 +0000
commit6823922baa9898cd489a1eaed38b715e134c1f2a (patch)
treee9b84b08c339755da3cbc1aa7aa7ba6a6cd38fd4 /lib/mesa/src
parent13817263a7bcd8b84c1f2d1c34a1530119bc9317 (diff)
Don't depend on indirect inclusion to pick up endian.h and define
BYTE_ORDER. Tested by and ok visa@ mpi@
Diffstat (limited to 'lib/mesa/src')
-rw-r--r--lib/mesa/src/mesa/main/compiler.h22
1 files changed, 5 insertions, 17 deletions
diff --git a/lib/mesa/src/mesa/main/compiler.h b/lib/mesa/src/mesa/main/compiler.h
index 93b4e6f12..d1e98d0b4 100644
--- a/lib/mesa/src/mesa/main/compiler.h
+++ b/lib/mesa/src/mesa/main/compiler.h
@@ -66,28 +66,16 @@ extern "C" {
* Try to use a runtime test instead.
* For now, only used by some DRI hardware drivers for color/texel packing.
*/
-#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
-#if defined(__linux__)
-#include <byteswap.h>
-#define CPU_TO_LE32( x ) bswap_32( x )
-#elif defined(__APPLE__)
-#include <CoreFoundation/CFByteOrder.h>
-#define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x )
-#elif defined(__OpenBSD__)
-#include <sys/types.h>
+#ifdef __OpenBSD__
+#include <endian.h>
#define CPU_TO_LE32( x ) htole32( x )
-#else /*__linux__ */
-#include <sys/endian.h>
-#define CPU_TO_LE32( x ) bswap32( x )
-#endif /*__linux__*/
+#define LE32_TO_CPU( x ) letoh32( x )
+#if BYTE_ORDER == BIG_ENDIAN
#define MESA_BIG_ENDIAN 1
#else
-#define CPU_TO_LE32( x ) ( x )
#define MESA_LITTLE_ENDIAN 1
#endif
-#define LE32_TO_CPU( x ) CPU_TO_LE32( x )
-
-
+#endif /* __OpenBSD__ */
#define IEEE_ONE 0x3f800000