diff --git a/src/fileformats.c b/src/fileformats.c index c180d139..0fb03133 100644 --- a/src/fileformats.c +++ b/src/fileformats.c @@ -57,11 +57,16 @@ #include +#if defined(WIN32) #if defined(_MSC_VER) #include #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++)