]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix check for GCC >= 4.8
authorTim Kientzle <kientzle@acm.org>
Sun, 17 Jul 2016 15:28:51 +0000 (08:28 -0700)
committerTim Kientzle <kientzle@acm.org>
Sun, 17 Jul 2016 15:28:51 +0000 (08:28 -0700)
libarchive/archive_read_support_format_lha.c

index dbfc1cd87c86d6b9e8b70eb4568bd97441465fa0..a7f1d8d949f5723d47cc6cc604c88558691ff9f9 100644 (file)
@@ -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))