13 #if TARGET_win32 || TARGET_win64
14 #define __BYTE_ORDER __LITTLE_ENDIAN
15 inline uint16_t __bswap_16(uint16_t v){
17 const char* sp = (
const char*)&v;
25 inline uint32_t __bswap_32(uint32_t v){
27 const char* sp = (
const char*)&v;
37 inline uint64_t __bswap_64(uint64_t v){
39 const char* sp = (
const char*)&v;
59 # if __BYTE_ORDER == __LITTLE_ENDIAN
60 # define htobe16(x) __bswap_16 (x)
61 # define htole16(x) (x)
62 # define be16toh(x) __bswap_16 (x)
63 # define le16toh(x) (x)
65 # define htobe32(x) __bswap_32 (x)
66 # define htole32(x) (x)
67 # define be32toh(x) __bswap_32 (x)
68 # define le32toh(x) (x)
70 # define htobe64(x) __bswap_64 (x)
71 # define htole64(x) (x)
72 # define be64toh(x) __bswap_64 (x)
73 # define le64toh(x) (x)
75 # define htobe16(x) (x)
76 # define htole16(x) __bswap_16 (x)
77 # define be16toh(x) (x)
78 # define le16toh(x) __bswap_16 (x)
80 # define htobe32(x) (x)
81 # define htole32(x) __bswap_32 (x)
82 # define be32toh(x) (x)
83 # define le32toh(x) __bswap_32 (x)
85 # define htobe64(x) (x)
86 # define htole64(x) __bswap_64 (x)
87 # define be64toh(x) (x)
88 # define le64toh(x) __bswap_64 (x)
93 const char* sp = (
const char*)s;
100 const char* sp = (
const char*)s;
108 const char* sp = (
const char*)s;
118 const char* sp = (
const char*)s;
131 void bswap_copy(
int swap,
const void* src,
void* dst,
BUInt32 nBytes,
const char* swapType);
void bswap_p64(const void *s, void *d)
Definition: BEndian.h:117
uint16_t betoh(uint16_t v)
Definition: BEndian.h:280
#define htole64(x)
Definition: BEndian.h:71
#define htole16(x)
Definition: BEndian.h:61
void bswap_copy(int swap, const void *src, void *dst, BUInt32 nBytes, const char *swapType)
Definition: BEndian.cpp:11
uint16_t htole(uint16_t v)
Definition: BEndian.h:134
#define htobe16(x)
Definition: BEndian.h:60
void bswap_p8(const void *s, void *d)
Definition: BEndian.h:92
#define htobe64(x)
Definition: BEndian.h:70
void bswap_p32(const void *s, void *d)
Definition: BEndian.h:107
#define le16toh(x)
Definition: BEndian.h:63
#define be32toh(x)
Definition: BEndian.h:67
void bswap_p16(const void *s, void *d)
Definition: BEndian.h:99
uint16_t letoh(uint16_t v)
Definition: BEndian.h:231
#define htole32(x)
Definition: BEndian.h:66
#define htobe32(x)
Definition: BEndian.h:65
uint16_t htobe(uint16_t v)
Definition: BEndian.h:182
#define be16toh(x)
Definition: BEndian.h:62
#define le32toh(x)
Definition: BEndian.h:68
#define be64toh(x)
Definition: BEndian.h:72
#define le64toh(x)
Definition: BEndian.h:73
uint32_t BUInt32
Definition: BTypes.h:24