diff options
author | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2014-09-14 22:27:45 +0900 |
---|---|---|
committer | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2014-09-14 22:27:45 +0900 |
commit | ce08c48484fd9f6bc2023c2f3647ee3a82a159c1 (patch) | |
tree | c827e91f4f2107902d401bb965ab777e4e0b5e8f /libarchive/archive_read_support_format_lha.c | |
parent | 8267d663154f769e520c41603aae489478f8fe20 (diff) | |
download | libarchive-ce08c48484fd9f6bc2023c2f3647ee3a82a159c1.tar.gz |
Fix build failure on FreeBSD 9.2.
Diffstat (limited to 'libarchive/archive_read_support_format_lha.c')
-rw-r--r-- | libarchive/archive_read_support_format_lha.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c index 4daba947..223ef02f 100644 --- a/libarchive/archive_read_support_format_lha.c +++ b/libarchive/archive_read_support_format_lha.c @@ -1712,10 +1712,11 @@ lha_crc16(uint16_t crc, const void *pp, size_t len) * remove the stament which will not be executed. */ #ifdef _MSC_VER /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) -#elif defined(__GNUC__) || defined(__clang__) +#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8) \ + || defined(__clang__) # define bswap16(x) __builtin_bswap16(x) #else -# define bswap16(x) ((((b) >> 8) & 0xff) | ((b) << 8)) +# define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8)) #endif #define CRC16W do { \ if(u.c[0] == 1) { /* Big endian */ \ |