summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOzkan Sezer <sezero@users.noreply.github.com>2022-10-17 08:28:08 +0300
committerGitHub <noreply@github.com>2022-10-17 07:28:08 +0200
commit5a9ffda85271e406c1dfb2872005b9abd83438c3 (patch)
tree6b933dffd7083e4c1725166d371f5a3a875ff9f1
parent75ef7958df603ca6de29fa00e82615e0da017903 (diff)
downloadflac-5a9ffda85271e406c1dfb2872005b9abd83438c3.tar.gz
fix broken bswap.m4
it used to always define HAVE_BSWAP32 and HAVE_BSWAP16 even if the builtin isn't supported. This broke with commit bfe5ff9
-rw-r--r--m4/bswap.m428
1 files changed, 8 insertions, 20 deletions
diff --git a/m4/bswap.m4 b/m4/bswap.m4
index 0e24140f..54bb8f0b 100644
--- a/m4/bswap.m4
+++ b/m4/bswap.m4
@@ -39,16 +39,10 @@ AC_DEFUN([XIPH_C_BSWAP32],
[AC_CACHE_CHECK(for bswap32 intrinsic,
ac_cv_c_bswap32,
- # Initialize to no
- ac_cv_c_bswap32=no
- HAVE_BSWAP32=0
-
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return __builtin_bswap32 (0) ;]])],[ac_cv_c_bswap32=yes
- HAVE_BSWAP32=1
- ],[])]
- AC_DEFINE_UNQUOTED(HAVE_BSWAP32, ${HAVE_BSWAP32},
- [Compiler has the __builtin_bswap32 intrinsic])
-
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[return __builtin_bswap32 (0) ;]])],[ac_cv_c_bswap32=yes],[ac_cv_c_bswap32=no])
+ if test $ac_cv_c_bswap32 = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_BSWAP32, [1], [Compiler has the __builtin_bswap32 intrinsic])
+ fi
)]
)# XIPH_C_BSWAP32
@@ -64,15 +58,9 @@ AC_DEFUN([XIPH_C_BSWAP16],
[AC_CACHE_CHECK(for bswap16 intrinsic,
ac_cv_c_bswap16,
- # Initialize to no
- ac_cv_c_bswap16=no
- HAVE_BSWAP16=0
-
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return __builtin_bswap16 (0) ;]])],[ac_cv_c_bswap16=yes
- HAVE_BSWAP16=1
- ],[])]
- AC_DEFINE_UNQUOTED(HAVE_BSWAP16, ${HAVE_BSWAP16},
- [Compiler has the __builtin_bswap16 intrinsic])
-
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[return __builtin_bswap16 (0) ;]])],[ac_cv_c_bswap16=yes],[ac_cv_c_bswap16=no])
+ if test $ac_cv_c_bswap16 = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_BSWAP16, [1], [Compiler has the __builtin_bswap16 intrinsic])
+ fi
)]
)# XIPH_C_BSWAP16