]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
isnan-no-c++: New module.
authorBruno Haible <bruno@clisp.org>
Fri, 19 Dec 2025 22:43:17 +0000 (23:43 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 19 Dec 2025 22:43:17 +0000 (23:43 +0100)
* modules/isnan-no-c++: New file, based on modules/isnan.
* modules/isnan: Essentially an alias of isnan-no-c++ now.
* modules/isnan-no-c++-tests: Renamed from modules/isnan-tests.
* lib/math.in.h (isnan): Test also GNULIB_ISNAN_NO_CXX.
* m4/math_h.m4 (gl_MATH_H_REQUIRE_DEFAULTS): Initialize
GNULIB_ISNAN_NO_CXX.
* modules/math-h (Makefile.am): Substitute GNULIB_ISNAN_NO_CXX.

ChangeLog
lib/math.in.h
m4/math_h.m4
modules/isnan
modules/isnan-no-c++ [new file with mode: 0644]
modules/isnan-no-c++-tests [moved from modules/isnan-tests with 100% similarity]
modules/math-h

index b6dfdd68b93e9c6902ab05531cc1521ee2111a4e..e45d5ece13001662a39aefa521493b5e98e29578 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2025-12-19  Bruno Haible  <bruno@clisp.org>
+
+       isnan-no-c++: New module.
+       * modules/isnan-no-c++: New file, based on modules/isnan.
+       * modules/isnan: Essentially an alias of isnan-no-c++ now.
+       * modules/isnan-no-c++-tests: Renamed from modules/isnan-tests.
+       * lib/math.in.h (isnan): Test also GNULIB_ISNAN_NO_CXX.
+       * m4/math_h.m4 (gl_MATH_H_REQUIRE_DEFAULTS): Initialize
+       GNULIB_ISNAN_NO_CXX.
+       * modules/math-h (Makefile.am): Substitute GNULIB_ISNAN_NO_CXX.
+
 2025-12-19  Bruno Haible  <bruno@clisp.org>
 
        isinf-no-c++: New module.
index 30ec254332e993bcbf3cfb2fd22d0ab2881627af..9eb0bbb6426335fd2605d3783aeed8db33e86fe3 100644 (file)
@@ -2611,7 +2611,7 @@ _GL_EXTERN_C int isnanl (long double x) _GL_ATTRIBUTE_CONST;
 #endif
 
 /* This must come *after* the snippets for GNULIB_ISNANF and GNULIB_ISNANL!  */
-#if @GNULIB_ISNAN@
+#if @GNULIB_ISNAN@ || @GNULIB_ISNAN_NO_CXX@
 # if @REPLACE_ISNAN@
 /* We can't just use the isnanf macro (e.g.) as exposed by
    isnanf.h (e.g.) here, because those may end up being macros
@@ -2647,7 +2647,7 @@ _GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
     sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
     __builtin_isnan ((float)(x)))
 # endif
-# ifdef __cplusplus
+# if @GNULIB_ISNAN@ && defined __cplusplus
 #  if defined isnan || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan)
 #   undef isnan
index ad079253838ecf82c59eb2b1182b6e480ceeaffe..2ff9e25238e36ed8d4bf8f28c524ebb2d09a1588 100644 (file)
@@ -1,5 +1,5 @@
 # math_h.m4
-# serial 144
+# serial 145
 dnl Copyright (C) 2007-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -135,6 +135,7 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF_NO_CXX])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN_NO_CXX])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL])
index ba96eb7c6f2c2e6dcf9392555c1f96849d1d6d9f..9764e972f8dbb315ad1e8daff4ad8ff16ce50aa4 100644 (file)
@@ -2,18 +2,11 @@ Description:
 isnan macro: test for NaN value.
 
 Files:
-m4/isnan.m4
 
 Depends-on:
-isnanf
-isnand
-isnanl
-math-h
-stringeq
-extensions
+isnan-no-c++
 
 configure.ac:
-gl_ISNAN
 gl_MATH_MODULE_INDICATOR([isnan])
 
 Makefile.am:
diff --git a/modules/isnan-no-c++ b/modules/isnan-no-c++
new file mode 100644 (file)
index 0000000..db1ef39
--- /dev/null
@@ -0,0 +1,28 @@
+Description:
+isnan macro: test for NaN value.
+
+Files:
+m4/isnan.m4
+
+Depends-on:
+isnanf
+isnand
+isnanl
+math-h
+stringeq
+extensions
+
+configure.ac:
+gl_ISNAN
+gl_MATH_MODULE_INDICATOR([isnan-no-cxx])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+License:
+LGPL
+
+Maintainer:
+Ben Pfaff
index 982cba28800884944a813794ef8b1621f93f5592..888a9a82ccf336e967c53696bfdac49f2b8e210f 100644 (file)
@@ -91,6 +91,7 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's/@''GNULIB_ISINF''@/$(GNULIB_ISINF)/g' \
              -e 's/@''GNULIB_ISINF_NO_CXX''@/$(GNULIB_ISINF_NO_CXX)/g' \
              -e 's/@''GNULIB_ISNAN''@/$(GNULIB_ISNAN)/g' \
+             -e 's/@''GNULIB_ISNAN_NO_CXX''@/$(GNULIB_ISNAN_NO_CXX)/g' \
              -e 's/@''GNULIB_ISNANF''@/$(GNULIB_ISNANF)/g' \
              -e 's/@''GNULIB_ISNAND''@/$(GNULIB_ISNAND)/g' \
              -e 's/@''GNULIB_ISNANL''@/$(GNULIB_ISNANL)/g' \