An attempt to get byteswap to work accross more machines.

--HG--
extra : convert_revision : 4a73507206cf287a89e1d496b2a08cfd1fafdf4d
This commit is contained in:
Gabe Black 2006-03-17 14:11:14 -05:00
parent 4f9ead58ff
commit c1a1f8ee95

View file

@ -79,11 +79,13 @@ static inline uint64_t swap_byte(uint64_t x) {return swap_byte64(x);}
static inline int64_t swap_byte(int64_t x) {return swap_byte64((uint64_t)x);}
static inline uint32_t swap_byte(uint32_t x) {return swap_byte32(x);}
static inline int32_t swap_byte(int32_t x) {return swap_byte32((uint32_t)x);}
//#if defined(__APPLE__)
//This is to prevent the following two functions from compiling on
//64bit machines. It won't detect everything, so it should be changed.
#ifndef __x86_64__
static inline long swap_byte(long x) {return swap_byte32((long)x);}
static inline unsigned long swap_byte(unsigned long x)
{ return swap_byte32((unsigned long)x);}
//#endif
#endif
static inline uint16_t swap_byte(uint16_t x) {return swap_byte32(x);}
static inline int16_t swap_byte(int16_t x) {return swap_byte16((uint16_t)x);}
static inline uint8_t swap_byte(uint8_t x) {return x;}