]> wimlib.net Git - wimlib/commitdiff
Use __builtin_bswap64() only if supported
authorEric Biggers <ebiggers3@gmail.com>
Sun, 28 Oct 2012 06:28:18 +0000 (01:28 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 28 Oct 2012 06:28:18 +0000 (01:28 -0500)
src/endianness.h

index 0a0728722d1e3d3a408644317a61583a23e49b05..72a37358b35c5294c25fddb7f440852594b43e44 100644 (file)
@@ -29,7 +29,7 @@ static inline uint32_t bswap32(uint32_t n)
 #ifndef bswap64
 static inline uint64_t bswap64(uint64_t n)
 {
 #ifndef bswap64
 static inline uint64_t bswap64(uint64_t n)
 {
-#ifdef __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
        return __builtin_bswap64(n);
 #else
        return (n << 56) | ((n & 0xff00) << 40) | ((n & 0xff0000) << 24) |
        return __builtin_bswap64(n);
 #else
        return (n << 56) | ((n & 0xff00) << 40) | ((n & 0xff0000) << 24) |