@@ -112,6 +112,9 @@ extern "C" {
112112
113113#if HAS_BUILTIN_BSWAP16
114114#define SDL_Swap16 (x ) __builtin_bswap16(x)
115+ #elif defined(_MSC_VER )
116+ #pragma intrinsic(_byteswap_ushort)
117+ #define SDL_Swap16 (x ) _byteswap_ushort(x)
115118#elif defined(__i386__ ) && !HAS_BROKEN_BSWAP
116119SDL_FORCE_INLINE Uint16
117120SDL_Swap16 (Uint16 x )
@@ -149,9 +152,6 @@ SDL_Swap16(Uint16 x)
149152 __asm__("rorw #8,%0" : "=d" (x ): "0" (x ):"cc" );
150153 return x ;
151154}
152- #elif defined(_MSC_VER )
153- #pragma intrinsic(_byteswap_ushort)
154- #define SDL_Swap16 (x ) _byteswap_ushort(x)
155155#elif defined(__WATCOMC__ ) && defined(__386__ )
156156extern _inline Uint16 SDL_Swap16 (Uint16 );
157157#pragma aux SDL_Swap16 = \
@@ -168,6 +168,9 @@ SDL_Swap16(Uint16 x)
168168
169169#if HAS_BUILTIN_BSWAP32
170170#define SDL_Swap32 (x ) __builtin_bswap32(x)
171+ #elif defined(_MSC_VER )
172+ #pragma intrinsic(_byteswap_ulong)
173+ #define SDL_Swap32 (x ) _byteswap_ulong(x)
171174#elif defined(__i386__ ) && !HAS_BROKEN_BSWAP
172175SDL_FORCE_INLINE Uint32
173176SDL_Swap32 (Uint32 x )
@@ -213,9 +216,6 @@ extern _inline Uint32 SDL_Swap32(Uint32);
213216 "bswap eax" \
214217 parm [eax] \
215218 modify [eax];
216- #elif defined(_MSC_VER )
217- #pragma intrinsic(_byteswap_ulong)
218- #define SDL_Swap32 (x ) _byteswap_ulong(x)
219219#else
220220SDL_FORCE_INLINE Uint32
221221SDL_Swap32 (Uint32 x )
@@ -227,6 +227,9 @@ SDL_Swap32(Uint32 x)
227227
228228#if HAS_BUILTIN_BSWAP64
229229#define SDL_Swap64 (x ) __builtin_bswap64(x)
230+ #elif defined(_MSC_VER )
231+ #pragma intrinsic(_byteswap_uint64)
232+ #define SDL_Swap64 (x ) _byteswap_uint64(x)
230233#elif defined(__i386__ ) && !HAS_BROKEN_BSWAP
231234SDL_FORCE_INLINE Uint64
232235SDL_Swap64 (Uint64 x )
@@ -258,9 +261,6 @@ extern _inline Uint64 SDL_Swap64(Uint64);
258261 "xchg eax,edx" \
259262 parm [eax edx] \
260263 modify [eax edx];
261- #elif defined(_MSC_VER )
262- #pragma intrinsic(_byteswap_uint64)
263- #define SDL_Swap64 (x ) _byteswap_uint64(x)
264264#else
265265SDL_FORCE_INLINE Uint64
266266SDL_Swap64 (Uint64 x )
0 commit comments