1 2 #include <BeOSBuildCompatibility.h> 3 4 #include <ByteOrder.h> 5 6 uint16 7 __swap_int16(uint16 value) 8 { 9 return (value >> 8) | (value << 8); 10 } 11 12 uint32 13 __swap_int32(uint32 value) 14 { 15 return (value >> 24) | ((value & 0xff0000) >> 8) | ((value & 0xff00) << 8) 16 | (value << 24); 17 } 18 19 uint64 20 __swap_int64(uint64 value) 21 { 22 return uint64(__swap_int32(uint32(value >> 32))) 23 | (uint64(__swap_int32(uint32(value))) << 32); 24 } 25