1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 04:59:11 +00:00

(svn r25685) -Codechange: [OSX] Use non-deprecated functions for byte swapping.

This commit is contained in:
michi_cc
2013-08-05 20:37:29 +00:00
parent 0883cf76e3
commit de097dd989

@@ -365,8 +365,8 @@ static inline T ROR(const T x, const uint8 n)
* (since it will use hardware swapping if available). * (since it will use hardware swapping if available).
* Even though they should return uint16 and uint32, we get * Even though they should return uint16 and uint32, we get
* warnings if we don't cast those (why?) */ * warnings if we don't cast those (why?) */
#define BSWAP32(x) ((uint32)Endian32_Swap(x)) #define BSWAP32(x) ((uint32)CFSwapInt32(x))
#define BSWAP16(x) ((uint16)Endian16_Swap(x)) #define BSWAP16(x) ((uint16)CFSwapInt16(x))
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
/* MSVC has intrinsics for swapping, resulting in faster code */ /* MSVC has intrinsics for swapping, resulting in faster code */
#define BSWAP32(x) (_byteswap_ulong(x)) #define BSWAP32(x) (_byteswap_ulong(x))