+2025-12-19 Bruno Haible <bruno@clisp.org>
+
+ isfinite-no-c++: New module.
+ Reported by G. Branden Robinson <g.branden.robinson@gmail.com> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2025-12/msg00150.html>.
+ * modules/isfinite-no-c++: New file, based on modules/isfinite.
+ * modules/isfinite: Essentially an alias of isfinite-no-c++ now.
+ * modules/isfinite-no-c++-tests: Renamed from modules/isfinite-tests.
+ * lib/math.in.h (isfinite): Test also GNULIB_ISFINITE_NO_CXX.
+ * m4/math_h.m4 (gl_MATH_H_REQUIRE_DEFAULTS): Initialize
+ GNULIB_ISFINITE_NO_CXX.
+ * modules/math-h (Makefile.am): Substitute GNULIB_ISFINITE_NO_CXX.
+ * modules/cbrt (Depends-on): Add isfinite-no-c++. Remove isfinite.
+ * modules/cbrtf (Depends-on): Likewise.
+ * modules/cbrtl (Depends-on): Likewise.
+ * modules/fma (Depends-on): Likewise.
+ * modules/fmaf (Depends-on): Likewise.
+ * modules/fmal (Depends-on): Likewise.
+ * modules/fmod (Depends-on): Likewise.
+ * modules/fmodl (Depends-on): Likewise.
+ * modules/hypot (Depends-on): Likewise.
+ * modules/hypotl (Depends-on): Likewise.
+ * modules/ilogb (Depends-on): Likewise.
+ * modules/ilogbf (Depends-on): Likewise.
+ * modules/ilogbl (Depends-on): Likewise.
+ * modules/logb (Depends-on): Likewise.
+ * modules/logbf (Depends-on): Likewise.
+ * modules/logbl (Depends-on): Likewise.
+ * modules/modf (Depends-on): Likewise.
+ * modules/modfl (Depends-on): Likewise.
+ * modules/remainder (Depends-on): Likewise.
+ * modules/remainderf (Depends-on): Likewise.
+ * modules/remainderl (Depends-on): Likewise.
+
2025-12-15 Collin Funk <collin.funk1@gmail.com>
nanosleep: Avoid a redefinition on mingw.
declarations. */
-#if @GNULIB_ISFINITE@
+#if @GNULIB_ISFINITE@ || @GNULIB_ISFINITE_NO_CXX@
# if @REPLACE_ISFINITE@
_GL_EXTERN_C int gl_isfinitef (float x);
_GL_EXTERN_C int gl_isfinited (double x);
sizeof (x) == sizeof (double) ? gl_isfinited (x) : \
gl_isfinitef (x))
# endif
-# ifdef __cplusplus
+# if @GNULIB_ISFINITE@ && defined __cplusplus
# if defined isfinite || defined GNULIB_NAMESPACE
_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite)
# undef isfinite
# math_h.m4
-# serial 142
+# serial 143
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,
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBL])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE_NO_CXX])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF])
Depends-on:
math-h
extensions
-isfinite [test $HAVE_CBRT = 0]
+isfinite-no-c++ [test $HAVE_CBRT = 0]
fabs [test $HAVE_CBRT = 0]
frexp [test $HAVE_CBRT = 0]
ldexp [test $HAVE_CBRT = 0]
Depends-on:
math-h
extensions
-isfinite [test $HAVE_CBRTF = 0 || test $REPLACE_CBRTF = 1]
+isfinite-no-c++ [test $HAVE_CBRTF = 0 || test $REPLACE_CBRTF = 1]
fabsf [test $HAVE_CBRTF = 0 || test $REPLACE_CBRTF = 1]
frexpf [test $HAVE_CBRTF = 0 || test $REPLACE_CBRTF = 1]
ldexpf [test $HAVE_CBRTF = 0 || test $REPLACE_CBRTF = 1]
math-h
extensions
cbrt [{ test $HAVE_CBRTL = 0 || test $REPLACE_CBRTL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1]
-isfinite [{ test $HAVE_CBRTL = 0 || test $REPLACE_CBRTL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
+isfinite-no-c++ [{ test $HAVE_CBRTL = 0 || test $REPLACE_CBRTL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
frexpl [{ test $HAVE_CBRTL = 0 || test $REPLACE_CBRTL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
ldexpl [{ test $HAVE_CBRTL = 0 || test $REPLACE_CBRTL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
float-h [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
bool [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
assert-h [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
-isfinite [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
+isfinite-no-c++ [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
integer_length [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
frexp [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
ldexp [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
extensions
float-h [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
bool [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
-assert-h [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
-isfinite [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
+assert-h [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
+isfinite-no-c++ [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
integer_length [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
frexpf [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
ldexpf [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
float-h [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
bool [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
assert-h [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
-isfinite [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
+isfinite-no-c++ [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
integer_length [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
frexpl [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
ldexpl [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
Depends-on:
math-h
-isfinite [test $REPLACE_FMOD = 1]
+isfinite-no-c++ [test $REPLACE_FMOD = 1]
signbit [test $REPLACE_FMOD = 1]
fabs [test $REPLACE_FMOD = 1]
frexp [test $REPLACE_FMOD = 1]
extensions
fmod [{ test $HAVE_FMODL = 0 || test $REPLACE_FMODL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1]
float-h [{ test $HAVE_FMODL = 0 || test $REPLACE_FMODL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
-isfinite [{ test $HAVE_FMODL = 0 || test $REPLACE_FMODL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
+isfinite-no-c++ [{ test $HAVE_FMODL = 0 || test $REPLACE_FMODL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
signbit [{ test $HAVE_FMODL = 0 || test $REPLACE_FMODL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
fabsl [{ test $HAVE_FMODL = 0 || test $REPLACE_FMODL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
frexpl [{ test $HAVE_FMODL = 0 || test $REPLACE_FMODL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
Depends-on:
math-h
extensions
-isfinite [test $REPLACE_HYPOT = 1]
+isfinite-no-c++ [test $REPLACE_HYPOT = 1]
fabs [test $REPLACE_HYPOT = 1]
frexp [test $REPLACE_HYPOT = 1]
ldexp [test $REPLACE_HYPOT = 1]
math-h
extensions
hypot [{ test $HAVE_HYPOTL = 0 || test $REPLACE_HYPOTL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1]
-isfinite [{ test $HAVE_HYPOTL = 0 || test $REPLACE_HYPOTL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
+isfinite-no-c++ [{ test $HAVE_HYPOTL = 0 || test $REPLACE_HYPOTL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
fabsl [{ test $HAVE_HYPOTL = 0 || test $REPLACE_HYPOTL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
frexpl [{ test $HAVE_HYPOTL = 0 || test $REPLACE_HYPOTL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
ldexpl [{ test $HAVE_HYPOTL = 0 || test $REPLACE_HYPOTL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
Depends-on:
math-h
-isfinite [test $HAVE_ILOGB = 0 || test $REPLACE_ILOGB = 1]
+isfinite-no-c++ [test $HAVE_ILOGB = 0 || test $REPLACE_ILOGB = 1]
frexp [test $HAVE_ILOGB = 0 || test $REPLACE_ILOGB = 1]
isnand [test $HAVE_ILOGB = 0 || test $REPLACE_ILOGB = 1]
Depends-on:
math-h
extensions
-isfinite [test $HAVE_ILOGBF = 0 || test $REPLACE_ILOGBF = 1]
+isfinite-no-c++ [test $HAVE_ILOGBF = 0 || test $REPLACE_ILOGBF = 1]
frexpf [test $HAVE_ILOGBF = 0 || test $REPLACE_ILOGBF = 1]
isnanf [test $HAVE_ILOGBF = 0 || test $REPLACE_ILOGBF = 1]
math-h
extensions
ilogb [{ test $HAVE_ILOGBL = 0 || test $REPLACE_ILOGBL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1]
-isfinite [{ test $HAVE_ILOGBL = 0 || test $REPLACE_ILOGBL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
+isfinite-no-c++ [{ test $HAVE_ILOGBL = 0 || test $REPLACE_ILOGBL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
frexpl [{ test $HAVE_ILOGBL = 0 || test $REPLACE_ILOGBL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
isnanl [{ test $HAVE_ILOGBL = 0 || test $REPLACE_ILOGBL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
isfinite macro: test for finite value (zero, subnormal, or normal, and not infinite or NaN).
Files:
-lib/isfinite.c
-m4/isfinite.m4
-m4/check-math-lib.m4
-m4/exponentl.m4
-m4/exponentd.m4
-m4/math_h.m4
Depends-on:
-math-h
-extensions
-isnanf-nolibm [test $REPLACE_ISFINITE = 1]
-isnand-nolibm [test $REPLACE_ISFINITE = 1]
-isnanl-nolibm [test $REPLACE_ISFINITE = 1]
+isfinite-no-c++
configure.ac:
-gl_ISFINITE
-gl_CONDITIONAL([GL_COND_OBJ_ISFINITE], [test $REPLACE_ISFINITE = 1])
gl_MATH_MODULE_INDICATOR([isfinite])
Makefile.am:
-if GL_COND_OBJ_ISFINITE
-lib_SOURCES += isfinite.c
-endif
Include:
<math.h>
--- /dev/null
+Description:
+isfinite macro: test for finite value (zero, subnormal, or normal, and not infinite or NaN).
+
+Files:
+lib/isfinite.c
+m4/isfinite.m4
+m4/check-math-lib.m4
+m4/exponentl.m4
+m4/exponentd.m4
+m4/math_h.m4
+
+Depends-on:
+math-h
+extensions
+isnanf-nolibm [test $REPLACE_ISFINITE = 1]
+isnand-nolibm [test $REPLACE_ISFINITE = 1]
+isnanl-nolibm [test $REPLACE_ISFINITE = 1]
+
+configure.ac:
+gl_ISFINITE
+gl_CONDITIONAL([GL_COND_OBJ_ISFINITE], [test $REPLACE_ISFINITE = 1])
+gl_MATH_MODULE_INDICATOR([isfinite-no-cxx])
+
+Makefile.am:
+if GL_COND_OBJ_ISFINITE
+lib_SOURCES += isfinite.c
+endif
+
+Include:
+<math.h>
+
+License:
+LGPL
+
+Maintainer:
+Ben Pfaff
Depends-on:
math-h
extensions
-isfinite [test $HAVE_LOGB = 0 || test $REPLACE_LOGB = 1]
+isfinite-no-c++ [test $HAVE_LOGB = 0 || test $REPLACE_LOGB = 1]
frexp [test $HAVE_LOGB = 0 || test $REPLACE_LOGB = 1]
isnand [test $HAVE_LOGB = 0 || test $REPLACE_LOGB = 1]
Depends-on:
math-h
extensions
-isfinite [test $HAVE_LOGBF = 0 || test $REPLACE_LOGBF = 1]
+isfinite-no-c++ [test $HAVE_LOGBF = 0 || test $REPLACE_LOGBF = 1]
frexpf [test $HAVE_LOGBF = 0 || test $REPLACE_LOGBF = 1]
isnanf [test $HAVE_LOGBF = 0 || test $REPLACE_LOGBF = 1]
math-h
extensions
logb [{ test $HAVE_LOGBL = 0 || test $REPLACE_LOGBL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1]
-isfinite [{ test $HAVE_LOGBL = 0 || test $REPLACE_LOGBL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
+isfinite-no-c++ [{ test $HAVE_LOGBL = 0 || test $REPLACE_LOGBL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
frexpl [{ test $HAVE_LOGBL = 0 || test $REPLACE_LOGBL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
isnanl [{ test $HAVE_LOGBL = 0 || test $REPLACE_LOGBL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
-e 's/@''GNULIB_ILOGBF''@/$(GNULIB_ILOGBF)/g' \
-e 's/@''GNULIB_ILOGBL''@/$(GNULIB_ILOGBL)/g' \
-e 's/@''GNULIB_ISFINITE''@/$(GNULIB_ISFINITE)/g' \
+ -e 's/@''GNULIB_ISFINITE_NO_CXX''@/$(GNULIB_ISFINITE_NO_CXX)/g' \
-e 's/@''GNULIB_ISINF''@/$(GNULIB_ISINF)/g' \
-e 's/@''GNULIB_ISNAN''@/$(GNULIB_ISNAN)/g' \
-e 's/@''GNULIB_ISNANF''@/$(GNULIB_ISNANF)/g' \
Depends-on:
math-h
-isfinite [test $REPLACE_MODF = 1]
+isfinite-no-c++ [test $REPLACE_MODF = 1]
trunc [test $REPLACE_MODF = 1]
isinf [test $REPLACE_MODF = 1]
math-h
extensions
modf [{ test $HAVE_MODFL = 0 || test $REPLACE_MODFL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1]
-isfinite [{ test $HAVE_MODFL = 0 || test $REPLACE_MODFL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
+isfinite-no-c++ [{ test $HAVE_MODFL = 0 || test $REPLACE_MODFL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
truncl [{ test $HAVE_MODFL = 0 || test $REPLACE_MODFL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
isinf [{ test $HAVE_MODFL = 0 || test $REPLACE_MODFL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
Depends-on:
math-h
-isfinite [test $HAVE_REMAINDER = 0 || test $REPLACE_REMAINDER = 1]
+isfinite-no-c++ [test $HAVE_REMAINDER = 0 || test $REPLACE_REMAINDER = 1]
signbit [test $HAVE_REMAINDER = 0 || test $REPLACE_REMAINDER = 1]
fabs [test $HAVE_REMAINDER = 0 || test $REPLACE_REMAINDER = 1]
fmod [test $HAVE_REMAINDER = 0 || test $REPLACE_REMAINDER = 1]
math-h
extensions
remainder [test $HAVE_REMAINDERF = 0 || test $REPLACE_REMAINDERF = 1]
-isfinite [test $HAVE_REMAINDERF = 0 || test $REPLACE_REMAINDERF = 1]
+isfinite-no-c++ [test $HAVE_REMAINDERF = 0 || test $REPLACE_REMAINDERF = 1]
signbit [test $HAVE_REMAINDERF = 0 || test $REPLACE_REMAINDERF = 1]
fabsf [test $HAVE_REMAINDERF = 0 || test $REPLACE_REMAINDERF = 1]
fmodf [test $HAVE_REMAINDERF = 0 || test $REPLACE_REMAINDERF = 1]
extensions
remainder [{ test $HAVE_REMAINDERL = 0 || test $REPLACE_REMAINDERL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1]
float-h [{ test $HAVE_REMAINDERL = 0 || test $REPLACE_REMAINDERL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
-isfinite [{ test $HAVE_REMAINDERL = 0 || test $REPLACE_REMAINDERL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
+isfinite-no-c++ [{ test $HAVE_REMAINDERL = 0 || test $REPLACE_REMAINDERL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
signbit [{ test $HAVE_REMAINDERL = 0 || test $REPLACE_REMAINDERL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
fabsl [{ test $HAVE_REMAINDERL = 0 || test $REPLACE_REMAINDERL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
fmodl [{ test $HAVE_REMAINDERL = 0 || test $REPLACE_REMAINDERL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]