10 #ifndef __BLI_ENDIAN_SWITCH_H__
11 # error "this file isn't to be directly included"
29 #if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 408))
30 *val = __builtin_bswap16(*val);
32 unsigned short tval = *val;
33 *val = (tval >> 8) | (tval << 8);
46 *val = __builtin_bswap32(*val);
48 unsigned int tval = *val;
49 *val = ((tval >> 24)) | ((tval << 8) & 0x00ff0000) | ((tval >> 8) & 0x0000ff00) | ((tval << 24));
66 *val = __builtin_bswap64(*val);
69 *val = ((tval >> 56)) | ((tval << 40) & 0x00ff000000000000ll) |
70 ((tval << 24) & 0x0000ff0000000000ll) | ((tval << 8) & 0x000000ff00000000ll) |
71 ((tval >> 8) & 0x00000000ff000000ll) | ((tval >> 24) & 0x0000000000ff0000ll) |
72 ((tval >> 40) & 0x000000000000ff00ll) | ((tval << 56));
BLI_INLINE void BLI_endian_switch_float(float *val)
BLI_INLINE void BLI_endian_switch_int32(int *val)
BLI_INLINE void BLI_endian_switch_int64(int64_t *val)
BLI_INLINE void BLI_endian_switch_int16(short *val)
BLI_INLINE void BLI_endian_switch_uint16(unsigned short *val)
BLI_INLINE void BLI_endian_switch_uint32(unsigned int *val)
BLI_INLINE void BLI_endian_switch_uint64(uint64_t *val)
BLI_INLINE void BLI_endian_switch_double(double *val)
unsigned __int64 uint64_t