ByteOrder.h: add explicit casts when using gcc builtins

Those return uintNN_t types instead of our own types,
but uint32 for example is long while uint32_t isn't,
giving some trouble with the PRI* macros for example on PPC.
This commit is contained in:
François Revol 2015-04-21 00:11:41 +02:00
parent bdf0418f5c
commit 7dd1073833
1 changed files with 3 additions and 3 deletions

View File

@ -121,9 +121,9 @@ extern bool is_type_swapped(type_code type);
extern double __swap_double(double arg);
extern float __swap_float(float arg);
#if __GNUC__ >= 4
#define __swap_int64(arg) __builtin_bswap64(arg)
#define __swap_int32(arg) __builtin_bswap32(arg)
#define __swap_int16(arg) __builtin_bswap16(arg)
#define __swap_int64(arg) (uint64)__builtin_bswap64(arg)
#define __swap_int32(arg) (uint32)__builtin_bswap32(arg)
#define __swap_int16(arg) (uint16)__builtin_bswap16(arg)
#else
extern uint64 __swap_int64(uint64 arg);
extern uint32 __swap_int32(uint32 arg);