> +/* Byte swapping */ > +#if HAVE_BYTESWAP_H > +# include <byteswap.h> > +#endif > +#ifndef bswap_16 > +# define bswap_16(p) \ > + (((((uint16_t)(p)) & 0x00ff) << 8) | \ > + (((uint16_t)(p)) >> 8)); > +#endif
If you want to enter the twisty maze of all the platform #ifdefs, since this is one area where there has been no standardization, the Solaris equivalent is <sys/byteorder.h> and the macros are BSWAP_16 & BSWAP_32. http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/sys/byteorder.h#103 The xserver's glx/glxbyteorder.h has variants for a few more platforms (I thought I'd added Solaris in there at some point, but don't see it there now - the BSD & MacOS variants are there though.) -- -Alan Coopersmith- [email protected] Oracle Solaris Platform Engineering: X Window System _______________________________________________ Pixman mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/pixman
