]> Savannah Git Hosting - gnulib.git/commitdiff
roundl: Fix a link error on Linux/powerpc64le.
authorBruno Haible <bruno@clisp.org>
Fri, 5 Apr 2024 14:04:59 +0000 (16:04 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 8 Apr 2024 10:42:35 +0000 (12:42 +0200)
* m4/check-math-lib.m4 (gl_CHECK_MATH_LIB): Accept an additional TYPE
argument.
* m4/isfinite.m4 (gl_ISFINITE): Use the type 'double'.
* m4/isinf.m4 (gl_ISINF): Likewise.
* m4/round.m4 (gl_FUNC_ROUND): Likewise.
* m4/roundf.m4 (gl_FUNC_ROUNDF): Use the type 'float'.
* m4/roundl.m4 (gl_FUNC_ROUNDL): Use the type 'long double'.

ChangeLog
m4/check-math-lib.m4
m4/isfinite.m4
m4/isinf.m4
m4/round.m4
m4/roundf.m4
m4/roundl.m4

index de749b198c2d3b50b8a71e3120da3dc766e1e7be..6c7debb387819bea3f9ab8146d6433dd9e14e879 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-04-05  Bruno Haible  <bruno@clisp.org>
+
+       roundl: Fix a link error on Linux/powerpc64le.
+       * m4/check-math-lib.m4 (gl_CHECK_MATH_LIB): Accept an additional TYPE
+       argument.
+       * m4/isfinite.m4 (gl_ISFINITE): Use the type 'double'.
+       * m4/isinf.m4 (gl_ISINF): Likewise.
+       * m4/round.m4 (gl_FUNC_ROUND): Likewise.
+       * m4/roundf.m4 (gl_FUNC_ROUNDF): Use the type 'float'.
+       * m4/roundl.m4 (gl_FUNC_ROUNDL): Use the type 'long double'.
+
 2024-04-05  Bruno Haible  <bruno@clisp.org>
 
        expl tests: Avoid test failure on NetBSD 10.0/i386.
index 825e33adbda2a80937e70b74f719a308645daf8e..dbfab2a34976a2b6cdf98ea0761bd42c37177728 100644 (file)
@@ -1,17 +1,17 @@
-# check-math-lib.m4 serial 4
+# check-math-lib.m4 serial 4.1
 dnl Copyright (C) 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,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl gl_CHECK_MATH_LIB (VARIABLE, EXPRESSION [, EXTRA-CODE])
+dnl gl_CHECK_MATH_LIB (VARIABLE, TYPE, EXPRESSION [, EXTRA-CODE])
 dnl
 dnl Sets the shell VARIABLE according to the libraries needed by EXPRESSION
-dnl to compile and link: to the empty string if no extra libraries are needed,
-dnl to "-lm" if -lm is needed, or to "missing" if it does not compile and
-dnl link either way.
+dnl (that operates on a variable x of type TYPE) to compile and link: to the
+dnl empty string if no extra libraries are needed, to "-lm" if -lm is needed,
+dnl or to "missing" if it does not compile and link either way.
 dnl
-dnl Example: gl_CHECK_MATH_LIB([ROUNDF_LIBM], [x = roundf (x);])
+dnl Example: gl_CHECK_MATH_LIB([ROUNDF_LIBM], [float], [x = roundf (x);])
 AC_DEFUN([gl_CHECK_MATH_LIB], [
   save_LIBS=$LIBS
   $1=missing
@@ -22,9 +22,9 @@ AC_DEFUN([gl_CHECK_MATH_LIB], [
          # define __NO_MATH_INLINES 1 /* for glibc */
          #endif
          #include <math.h>
-         $3
-         double x;]],
-      [$2])],
+         $4
+         $2 x;]],
+      [$3])],
       [$1=$libm
 break])
   done
index 972722653db91bd9d6f0cb6ae71b44af43175321..d2d88a22f467031fdcf5c06029aec61dc968b820 100644 (file)
@@ -1,4 +1,4 @@
-# isfinite.m4 serial 19
+# isfinite.m4 serial 19.1
 dnl Copyright (C) 2007-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,
@@ -12,8 +12,8 @@ AC_DEFUN([gl_ISFINITE],
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_CHECK_DECLS([isfinite], , , [[#include <math.h>]])
   if test "$ac_cv_have_decl_isfinite" = yes; then
-    gl_CHECK_MATH_LIB([ISFINITE_LIBM],
-     [x = isfinite (x) + isfinite ((float) x);])
+    gl_CHECK_MATH_LIB([ISFINITE_LIBM], [double],
+      [x = isfinite (x) + isfinite ((float) x);])
     if test "$ISFINITE_LIBM" != missing; then
       dnl Test whether isfinite() on 'long double' works.
       gl_ISFINITEL_WORKS
index b613f6638cdf1f80606d65fbca379d8583e734e7..c8b6dd46a189c5a262f2c5e1b302a235104610b3 100644 (file)
@@ -1,4 +1,4 @@
-# isinf.m4 serial 14
+# isinf.m4 serial 14.1
 dnl Copyright (C) 2007-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,
@@ -17,7 +17,8 @@ AC_DEFUN([gl_ISINF],
       #endif
     ]])
   if test "$ac_cv_have_decl_isinf" = yes; then
-    gl_CHECK_MATH_LIB([ISINF_LIBM], [x = isinf (x) + isinf ((float) x);])
+    gl_CHECK_MATH_LIB([ISINF_LIBM], [double],
+      [x = isinf (x) + isinf ((float) x);])
     if test "$ISINF_LIBM" != missing; then
       dnl Test whether isinf() on 'long double' works.
       gl_ISINFL_WORKS
index c7d36408e6d39999eec87597df64b788753d0376..9ee8851acbaf01d5d65bb11d10ac974c54ae54dc 100644 (file)
@@ -1,4 +1,4 @@
-# round.m4 serial 26
+# round.m4 serial 26.1
 dnl Copyright (C) 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,
@@ -12,7 +12,7 @@ AC_DEFUN([gl_FUNC_ROUND],
   dnl Persuade glibc <math.h> to declare round().
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
-  gl_CHECK_MATH_LIB([ROUND_LIBM], [x = round (x);],
+  gl_CHECK_MATH_LIB([ROUND_LIBM], [double], [x = round (x);],
     [extern
      #ifdef __cplusplus
      "C"
index 0193d6c0183eb40fc985eefdf3d7ea91cf51a4f8..4510f883d1f1e1cda77d642e1ca28febcfa22ff7 100644 (file)
@@ -1,4 +1,4 @@
-# roundf.m4 serial 27
+# roundf.m4 serial 27.1
 dnl Copyright (C) 2007-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,
@@ -12,7 +12,7 @@ AC_DEFUN([gl_FUNC_ROUNDF],
   dnl Persuade glibc <math.h> to declare roundf().
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
-  gl_CHECK_MATH_LIB([ROUNDF_LIBM], [x = roundf (x);],
+  gl_CHECK_MATH_LIB([ROUNDF_LIBM], [float], [x = roundf (x);],
     [extern
      #ifdef __cplusplus
      "C"
index f1b2bb4cb401ae7232ec7ba7162fa0635f4bc9e8..130bea009ccc218c1365c48eb05de3729e40641f 100644 (file)
@@ -1,4 +1,4 @@
-# roundl.m4 serial 22
+# roundl.m4 serial 22.1
 dnl Copyright (C) 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,
@@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_ROUNDL],
   dnl Persuade glibc <math.h> to declare roundl().
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
-  gl_CHECK_MATH_LIB([ROUNDL_LIBM], [x = roundl (x);],
+  gl_CHECK_MATH_LIB([ROUNDL_LIBM], [long double], [x = roundl (x);],
     [extern
      #ifdef __cplusplus
      "C"