From: Tim Kientzle Date: Sun, 17 Jul 2016 15:28:51 +0000 (-0700) Subject: Fix check for GCC >= 4.8 X-Git-Tag: v3.2.2~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2e8111b3a3468102737f7d414ea1bb6f6904bfe;p=thirdparty%2Flibarchive.git Fix check for GCC >= 4.8 --- diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c index dbfc1cd87..a7f1d8d94 100644 --- a/libarchive/archive_read_support_format_lha.c +++ b/libarchive/archive_read_support_format_lha.c @@ -1715,8 +1715,11 @@ lha_crc16(uint16_t crc, const void *pp, size_t len) #undef bswap16 #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) -#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8) \ - || defined(__clang__) +#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4) +/* GCC 4.8 and later has __builtin_bswap16() */ +# define bswap16(x) __builtin_bswap16(x) +#elif defined(__clang__) +/* All clang versions have __builtin_bswap16() */ # define bswap16(x) __builtin_bswap16(x) #else # define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8))