| Index: sky/engine/wtf/ByteSwap.h
|
| diff --git a/sky/engine/wtf/ByteSwap.h b/sky/engine/wtf/ByteSwap.h
|
| index 51012b93da5c900b93221529d70b2a4ffd63bc79..ddc0e8fe43285b31003247a8f01dd731c13d0c9d 100644
|
| --- a/sky/engine/wtf/ByteSwap.h
|
| +++ b/sky/engine/wtf/ByteSwap.h
|
| @@ -36,10 +36,22 @@
|
|
|
| #include <stdint.h>
|
|
|
| +#if COMPILER(MSVC)
|
| +#include <stdlib.h>
|
| +#endif
|
| +
|
| namespace WTF {
|
|
|
| inline uint32_t wswap32(uint32_t x) { return ((x & 0xffff0000) >> 16) | ((x & 0x0000ffff) << 16); }
|
|
|
| +#if COMPILER(MSVC)
|
| +
|
| +ALWAYS_INLINE uint64_t bswap64(uint64_t x) { return _byteswap_uint64(x); }
|
| +ALWAYS_INLINE uint32_t bswap32(uint32_t x) { return _byteswap_ulong(x); }
|
| +ALWAYS_INLINE uint16_t bswap16(uint16_t x) { return _byteswap_ushort(x); }
|
| +
|
| +#else
|
| +
|
| ALWAYS_INLINE uint64_t bswap64(uint64_t x) { return __builtin_bswap64(x); }
|
| ALWAYS_INLINE uint32_t bswap32(uint32_t x) { return __builtin_bswap32(x); }
|
| // GCC 4.6 lacks __builtin_bswap16. Newer versions have it but we support 4.6.
|
| @@ -49,6 +61,8 @@ ALWAYS_INLINE uint16_t bswap16(uint16_t x) { return __builtin_bswap16(x); }
|
| inline uint16_t bswap16(uint16_t x) { return ((x & 0xff00) >> 8) | ((x & 0x00ff) << 8); }
|
| #endif
|
|
|
| +#endif
|
| +
|
| #if CPU(64BIT)
|
|
|
| ALWAYS_INLINE size_t bswapuintptrt(size_t x) { return bswap64(x); }
|
|
|