Remove unconditional use of glibc specific bswap_16() macro.
authorMichel Dänzer <daenzer@vmware.com>
Tue, 17 Nov 2009 18:41:29 +0000 (19:41 +0100)
committerMichel Dänzer <michel@daenzer.net>
Tue, 17 Nov 2009 18:41:29 +0000 (19:41 +0100)
Fixes unresolved symbol bswap_16 on non-glibc or little endian glibc platforms.

src/mesa/drivers/dri/common/spantmp2.h

index dd5e29f8ce6e27593a02ff2933111157babac93e..95f97414a9839d432275f0adb2ff607878b44cca 100644 (file)
 
 #define READ_RGBA( rgba, _x, _y )                                      \
    do {                                                                        \
-      GLushort p = bswap_16(GET_VALUE(_x, _y));                         \
+      GLushort p = GET_VALUE(_x, _y);                                  \
+      p = p << 8 | p >> 8;                                             \
       rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8;                                \
       rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc;                                \
       rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8;                                \
 
 #define READ_RGBA( rgba, _x, _y )                                      \
    do {                                                                        \
-      GLushort p = bswap_16(GET_VALUE(_x, _y));                         \
+      GLushort p = GET_VALUE(_x, _y);                                  \
+      p = p << 8 | p >> 8;                                             \
       rgba[0] = ((p >> 7) & 0xf8) * 255 / 0xf8;                                \
       rgba[1] = ((p >> 2) & 0xf8) * 255 / 0xf8;                                \
       rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8;                                \