mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
stdinc: excplicitly cast output of __builtin_bswap32 to Uint32
This fixes a compile warning when using the output of SDL_Swap32
directly using the SDL_PRIu32 macro in C90 mode:
testplatform.c:158:17: warning: format '%lX' expects argument of
type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
158 | SDL_Log("Value 32 = 0x%" SDL_PRIX32 ", swapped = 0x%" SDL_PRIX32,
|
This commit is contained in:
parent
49c6a03da0
commit
bf43bbae31
1 changed files with 1 additions and 1 deletions
|
|
@ -286,7 +286,7 @@ SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x)
|
|||
/* Byte swap 32-bit integer. */
|
||||
#ifndef SDL_WIKI_DOCUMENTATION_SECTION
|
||||
#if HAS_BUILTIN_BSWAP32
|
||||
#define SDL_Swap32(x) __builtin_bswap32(x)
|
||||
#define SDL_Swap32(x) (Uint32)__builtin_bswap32(x)
|
||||
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
|
||||
#pragma intrinsic(_byteswap_ulong)
|
||||
#define SDL_Swap32(x) _byteswap_ulong(x)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue