00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SWBYTESWAP_H
00021 #define SWBYTESWAP_H
00022
00023 #ifdef BIGENDIAN
00024 #ifdef MACOSX
00025
00026 #include <architecture/byte_order.h>
00027 #define SWAP32(x) NXSwapLittleLongToHost(x)
00028 #define SWAP16(x) NXSwapLittleShortToHost(x)
00029
00030 #else
00031 #ifdef SPARC_SOLARIS
00032
00033 #include <sys/pctypes.h>
00034 #define SWAP32(x) lelong(x)
00035 #define SWAP16(x) leshort(x)
00036
00037 #else // all big endian GNU systems
00038
00039 #include <byteswap.h>
00040 #define SWAP32(x) bswap_32(x)
00041 #define SWAP16(x) bswap_16(x)
00042
00043 #endif
00044 #endif
00045 #else //little endian
00046
00047 #define SWAP32(x) x
00048 #define SWAP16(x) x
00049
00050 #endif
00051 #endif
00052