mesa: Define CPU_TO_LE32 to work on OpenBSD
authorMartin Pieuchot <mpi@openbsd.org>
Wed, 29 Aug 2012 12:46:27 +0000 (14:46 +0200)
committerBrian Paul <brianp@vmware.com>
Wed, 29 Aug 2012 14:05:17 +0000 (08:05 -0600)
Signed-off-by: Brian Paul <brianp@vmware.com>
src/mesa/main/compiler.h

index bfa06f37d7c0541fde6f82fc11459a1ce2e195ca..94484d8f3bc5346a483a16531fc69d9d04d0cd5d 100644 (file)
@@ -241,6 +241,9 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
            ((x & 0x00ff0000) >>  8) |
            ((x & 0xff000000) >> 24));
 }
+#elif defined(__OpenBSD__)
+#include <sys/types.h>
+#define CPU_TO_LE32( x )       htole32( x )
 #else /*__linux__ */
 #include <sys/endian.h>
 #define CPU_TO_LE32( x )       bswap32( x )