On Tue, Aug 21, 2012 at 01:12:28PM +0200, Martin Pieuchot wrote: > Diff below correctly defines the CPU_TO_LE32() macro for needed for > big-endian machines on OpenBSD. This is required to use dri on macppc. > > I'll do the necessary to get this upstream once it's in our tree. > > Tested with the r200 driver, ok? > > Martin bswap32 == swap32 for OpenBSD.
I think it would be better if you used swap32() here. > Index: src/mesa/main//compiler.h > =================================================================== > RCS file: /cvs/xenocara/dist/Mesa/src/mesa/main/compiler.h,v > retrieving revision 1.3 > diff -u -p -r1.3 compiler.h > --- src/mesa/main//compiler.h 17 Aug 2012 13:58:17 -0000 1.3 > +++ src/mesa/main//compiler.h 21 Aug 2012 09:10:49 -0000 > @@ -263,6 +263,9 @@ static INLINE GLuint CPU_TO_LE32(GLuint > ((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 ) > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
