win32 : fix byteswapping function for MSVC/gcc

This commit is contained in:
Thomas Bernard 2018-07-04 18:27:36 +02:00
parent 1d2ca270b1
commit 5f5d7ba1b0

View File

@ -57,11 +57,16 @@
#include <stdlib.h>
#if defined(WIN32)
#if defined(_MSC_VER)
#include <stdio.h>
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#define WIN32_BSWAP32 _byteswap_ulong
#else
#define WIN32_BSWAP32 __builtin_bswap32
#endif
#endif
#if !defined(WIN32) && !defined(USE_SDL) && !defined(USE_SDL2)
@ -1820,7 +1825,7 @@ void Load_IFF(T_IO_Context * context)
#elif defined(WIN32)
// assume WIN32 is little endian
for (i = 0 ; i < ((LineCount + 31) >> 5); i++)
lineBitMask[i] = __builtin_bswap32(lineBitMask[i]);
lineBitMask[i] = WIN32_BSWAP32(lineBitMask[i]);
#endif
data = (const byte *)PCHGData + ((LineCount + 31) >> 5) * 4;
for (y_pos = 0 ; y_pos < LineCount; y_pos++)