summaryrefslogtreecommitdiff
path: root/graphics/MesaLib/patches/patch-src_mesa_main_compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/MesaLib/patches/patch-src_mesa_main_compiler.h')
-rw-r--r--graphics/MesaLib/patches/patch-src_mesa_main_compiler.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/graphics/MesaLib/patches/patch-src_mesa_main_compiler.h b/graphics/MesaLib/patches/patch-src_mesa_main_compiler.h
new file mode 100644
index 00000000000..52c14c5a08b
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-src_mesa_main_compiler.h
@@ -0,0 +1,27 @@
+$NetBSD: patch-src_mesa_main_compiler.h,v 1.1 2013/05/16 05:22:02 richard Exp $
+
+--- src/mesa/main/compiler.h.orig 2011-11-23 01:09:52.000000000 +0000
++++ src/mesa/main/compiler.h
+@@ -248,7 +248,11 @@ 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
++#ifdef __sun
++#include <sys/isa_defs.h>
++#endif
++
++#if (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN) || defined(_BIG_ENDIAN)
+ #if defined(__linux__)
+ #include <byteswap.h>
+ #define CPU_TO_LE32( x ) bswap_32( x )
+@@ -263,6 +267,9 @@ static INLINE GLuint CPU_TO_LE32(GLuint
+ ((x & 0x00ff0000) >> 8) |
+ ((x & 0xff000000) >> 24));
+ }
++#elif defined(__sun)
++#include <sys/byteorder.h>
++#define CPU_TO_LE32( x ) BSWAP_32( x )
+ #else /*__linux__ */
+ #include <sys/endian.h>
+ #define CPU_TO_LE32( x ) bswap32( x )