1 #ifndef __FunFSBYTESWAP_H
2 #define __FunFSBYTESWAP_H
6 #include <netinet/in.h>
8 #if __BYTE_ORDER == __LITTLE_ENDIAN
9 # define SWAP64(x) _swap64(x)
10 # define SWAP32(x) _swap32(x)
11 # define SWAP16(x) _swap16(x)
12 #elif __BYTE_ORDER == __BIG_ENDIAN
19 inline unsigned long long int *_swap64(void *i
)
21 unsigned long long int *& p
= (unsigned long long int *)i
;
26 inline unsigned long int *_swap32(void *i
)
28 unsigned long int *& p
= (unsigned long int *)i
;
33 inline unsigned short int *_swap16(void *i
)
35 unsigned short int *& p
= (unsigned short int *)i
;
40 inline unsigned long long int abswap(unsigned long long int i
)
46 inline unsigned long int abswap(unsigned long int i
)
51 inline unsigned short int abswap(unsigned short int i
)