Merge pull request #1074 from rxrbln/dev

fixed legacy/zstd_v* with older gcc version, by guarding builtin_*
dev
Yann Collet 2018-03-25 18:26:24 -07:00 committed by GitHub
commit 0ef4d097db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -189,7 +189,7 @@ MEM_STATIC U32 MEM_swap32(U32 in)
{ {
#if defined(_MSC_VER) /* Visual Studio */ #if defined(_MSC_VER) /* Visual Studio */
return _byteswap_ulong(in); return _byteswap_ulong(in);
#elif defined (__GNUC__) #elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)
return __builtin_bswap32(in); return __builtin_bswap32(in);
#else #else
return ((in << 24) & 0xff000000 ) | return ((in << 24) & 0xff000000 ) |
@ -203,7 +203,7 @@ MEM_STATIC U64 MEM_swap64(U64 in)
{ {
#if defined(_MSC_VER) /* Visual Studio */ #if defined(_MSC_VER) /* Visual Studio */
return _byteswap_uint64(in); return _byteswap_uint64(in);
#elif defined (__GNUC__) #elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)
return __builtin_bswap64(in); return __builtin_bswap64(in);
#else #else
return ((in << 56) & 0xff00000000000000ULL) | return ((in << 56) & 0xff00000000000000ULL) |

View File

@ -348,7 +348,7 @@ MEM_STATIC U32 MEM_swap32(U32 in)
{ {
#if defined(_MSC_VER) /* Visual Studio */ #if defined(_MSC_VER) /* Visual Studio */
return _byteswap_ulong(in); return _byteswap_ulong(in);
#elif defined (__GNUC__) #elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)
return __builtin_bswap32(in); return __builtin_bswap32(in);
#else #else
return ((in << 24) & 0xff000000 ) | return ((in << 24) & 0xff000000 ) |
@ -362,7 +362,7 @@ MEM_STATIC U64 MEM_swap64(U64 in)
{ {
#if defined(_MSC_VER) /* Visual Studio */ #if defined(_MSC_VER) /* Visual Studio */
return _byteswap_uint64(in); return _byteswap_uint64(in);
#elif defined (__GNUC__) #elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)
return __builtin_bswap64(in); return __builtin_bswap64(in);
#else #else
return ((in << 56) & 0xff00000000000000ULL) | return ((in << 56) & 0xff00000000000000ULL) |