Simply do not use __builtin_bswap16() this causes all kinds of problems, use our own implementation

This commit is contained in:
jsteube
2017-01-21 18:23:11 +01:00
parent ec0f074f2d
commit 8d6170d66e
2 changed files with 7 additions and 19 deletions
-9
View File
@@ -45,17 +45,8 @@ u64 rotr64 (const u64 a, const u64 n)
u16 byte_swap_16 (const u16 n)
{
#if defined(__APPLE__)
return (n & 0xff00) >> 8
| (n & 0x00ff) << 8;
#elif defined (_MSC_VER)
return _byteswap_ushort (n);
#elif defined (__clang__) || defined (__GNUC__)
return __builtin_bswap16 (n);
#else
return (n & 0xff00) >> 8
| (n & 0x00ff) << 8;
#endif
}
u32 byte_swap_32 (const u32 n)