]> git.eshelyaron.com Git - emacs.git/commitdiff
Sync m4/byteswap.m4 from Gnulib
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 20 May 2024 17:12:56 +0000 (10:12 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 23 May 2024 08:28:17 +0000 (10:28 +0200)
* m4/byteswap.m4: Copy from Gnulib.  This fixes a configure
glitch on macOS reported by Mattias EngdegĂ„rd

(cherry picked from commit 642fd607b83c56847914a8a46d6c297a74529610)

m4/byteswap.m4

index 3f5ef45cfe6896b1f14c4705e80d3efe47ddca83..e91da97b958a25063314600a2d0ae727ac390a31 100644 (file)
@@ -1,5 +1,5 @@
 # byteswap.m4
-# serial 6
+# serial 7
 dnl Copyright (C) 2005, 2007, 2009-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,6 +15,10 @@ AC_DEFUN([gl_BYTESWAP],
     AC_CACHE_CHECK([for working bswap_16, bswap_32, bswap_64],
       [gl_cv_header_working_byteswap_h],
       [gl_cv_header_working_byteswap_h=no
+       dnl Check that floating point arguments work.
+       dnl This also checks C libraries with implementations like
+       dnl '#define bswap_16(x) (((x) >> 8 & 0xff) | (((x) & 0xff) << 8))'
+       dnl that mistakenly evaluate their arguments multiple times.
        AC_COMPILE_IFELSE(
          [AC_LANG_PROGRAM(
             [[#include <byteswap.h>
@@ -29,7 +33,7 @@ AC_DEFUN([gl_BYTESWAP],
          [gl_cv_header_working_byteswap_h=no])
       ])
   fi
-  if test $gl_cv_header_working_byteswap_h = yes; then
+  if test "$gl_cv_header_working_byteswap_h" = yes; then
     GL_GENERATE_BYTESWAP_H=false
   else
     GL_GENERATE_BYTESWAP_H=true