From 80441ff754d605068bdaae813bf64a23f4c000bc Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Fri, 7 Aug 2015 08:59:16 +0900 Subject: [PATCH] Remove a workaround for an older version of GCC. GLIBC's byte swap functions are a good fallback option. --- ConfigureChecks.cmake | 18 ++---------------- config.h.cmake | 4 +--- taglib/toolkit/tutils.h | 8 ++++---- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 0eb04018..88980ea1 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -107,30 +107,16 @@ endif() # Determine which kind of byte swap functions your compiler supports. -# GCC's __builtin_bswap* should be checked individually -# because some of them can be missing depends on the GCC version. check_cxx_source_compiles(" int main() { __builtin_bswap16(0); - return 0; - } -" HAVE_GCC_BYTESWAP_16) - -check_cxx_source_compiles(" - int main() { __builtin_bswap32(0); - return 0; - } -" HAVE_GCC_BYTESWAP_32) - -check_cxx_source_compiles(" - int main() { __builtin_bswap64(0); return 0; } -" HAVE_GCC_BYTESWAP_64) +" HAVE_GCC_BYTESWAP) -if(NOT HAVE_GCC_BYTESWAP_16 OR NOT HAVE_GCC_BYTESWAP_32 OR NOT HAVE_GCC_BYTESWAP_64) +if(NOT HAVE_GCC_BYTESWAP) check_cxx_source_compiles(" #include int main() { diff --git a/config.h.cmake b/config.h.cmake index 1bec58cc..ee0e67ac 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -1,9 +1,7 @@ /* config.h. Generated by cmake from config.h.cmake */ /* Defined if your compiler supports some byte swap functions */ -#cmakedefine HAVE_GCC_BYTESWAP_16 1 -#cmakedefine HAVE_GCC_BYTESWAP_32 1 -#cmakedefine HAVE_GCC_BYTESWAP_64 1 +#cmakedefine HAVE_GCC_BYTESWAP 1 #cmakedefine HAVE_GLIBC_BYTESWAP 1 #cmakedefine HAVE_MSC_BYTESWAP 1 #cmakedefine HAVE_MAC_BYTESWAP 1 diff --git a/taglib/toolkit/tutils.h b/taglib/toolkit/tutils.h index 68e5fc56..82f1dd9a 100644 --- a/taglib/toolkit/tutils.h +++ b/taglib/toolkit/tutils.h @@ -44,7 +44,7 @@ # include #endif -#include "tstring.h" +#include #include #include #include @@ -59,7 +59,7 @@ namespace TagLib */ inline ushort byteSwap(ushort x) { -#if defined(HAVE_GCC_BYTESWAP_16) +#if defined(HAVE_GCC_BYTESWAP) return __builtin_bswap16(x); @@ -91,7 +91,7 @@ namespace TagLib */ inline uint byteSwap(uint x) { -#if defined(HAVE_GCC_BYTESWAP_32) +#if defined(HAVE_GCC_BYTESWAP) return __builtin_bswap32(x); @@ -126,7 +126,7 @@ namespace TagLib */ inline ulonglong byteSwap(ulonglong x) { -#if defined(HAVE_GCC_BYTESWAP_64) +#if defined(HAVE_GCC_BYTESWAP) return __builtin_bswap64(x); -- 2.40.0