]> 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>
Fri, 5 Apr 2024 14:04:59 +0000 (16:04 +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 8c478f08b154363a0f72f367360894801f3ea19b..017125b3531440835ecf5595bed56ba6791b95ce 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>
 
        exp2l tests: Enable a test for glibc versions >= 2.16.
index 4f4eb5a346bfd33222e6e6aad640bea76076283c..1fc248dbbd56ec3d5c1b9750048232e87c380db1 100644 (file)
@@ -1,18 +1,18 @@
 # check-math-lib.m4
-# serial 5
+# serial 6
 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], [
   saved_LIBS="$LIBS"
   $1=missing
@@ -23,9 +23,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 1e30a93a9ed1060d9dbc0423c579f1e56ef85b27..c14a9e51f3b20131609f746b6a2710dbecb92f8f 100644 (file)
@@ -1,5 +1,5 @@
 # isfinite.m4
-# serial 19
+# serial 20
 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,
@@ -13,8 +13,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 000a6aa008e70c06f8e38781d8aa1e94675a1e0e..03dc1c19a21ad7118cda00b25202b1f7c47ed44c 100644 (file)
@@ -1,5 +1,5 @@
 # isinf.m4
-# serial 14
+# serial 15
 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,
@@ -18,7 +18,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 299c79d0daa5bf9021df236d3233d513c8be5748..7b419a42e77eca248d4f8b223c6fa406ad8b84db 100644 (file)
@@ -1,5 +1,5 @@
 # round.m4
-# serial 27
+# serial 28
 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_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 5899a6b02f699247dcd75e5140587f308fbf8ec6..bb9781344252757da388aafcd27ec9475f9278ce 100644 (file)
@@ -1,5 +1,5 @@
 # roundf.m4
-# serial 28
+# serial 29
 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,
@@ -13,7 +13,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 7f87e769a922bba0800948cc5414fad47d62f7c9..f845f6b07822db8e957b8dc422b61cac9fc50b7e 100644 (file)
@@ -1,5 +1,5 @@
 # roundl.m4
-# serial 23
+# serial 24
 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,
@@ -14,7 +14,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"