summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-08-07 08:14:38 +0800
committerPo Lu <luangruo@yahoo.com>2023-08-07 08:14:38 +0800
commit76cac8ae6f600be34f83bd3aaf9b38355eab773e (patch)
tree24951a85b6c4594503cf7d973ffaf680f17e0612 /m4
parent072a8a434eb0f39f6e4a0c956d3d8cf44b00cff8 (diff)
downloademacs-76cac8ae6f600be34f83bd3aaf9b38355eab773e.tar.gz
Update from Gnulib, remove printf-posix
* m4, lib: Update from Gnulib. * msdos/sedlibmk.inp: Remove variables deleted as part of previous change. * admin/merge-gnulib (GNULIB_MODULES): Remove vasprintf and printf-posix.
Diffstat (limited to 'm4')
-rw-r--r--m4/asm-underscore.m483
-rw-r--r--m4/exponentd.m4116
-rw-r--r--m4/exponentf.m492
-rw-r--r--m4/exponentl.m4112
-rw-r--r--m4/float_h.m4106
-rw-r--r--m4/frexp.m4181
-rw-r--r--m4/frexpl.m4233
-rw-r--r--m4/fseterr.m413
-rw-r--r--m4/gnulib-comp.m4210
-rw-r--r--m4/intmax_t.m459
-rw-r--r--m4/inttypes_h.m429
-rw-r--r--m4/isnand.m496
-rw-r--r--m4/isnanf.m4197
-rw-r--r--m4/isnanl.m4248
-rw-r--r--m4/ldexpl.m4135
-rw-r--r--m4/math_h.m4391
-rw-r--r--m4/printf-frexp.m438
-rw-r--r--m4/printf-frexpl.m448
-rw-r--r--m4/printf-posix.m436
-rw-r--r--m4/printf.m42158
-rw-r--r--m4/signbit.m4393
-rw-r--r--m4/size_max.m475
-rw-r--r--m4/stdint_h.m427
-rw-r--r--m4/vasnprintf.m4462
-rw-r--r--m4/vasprintf-posix.m4113
-rw-r--r--m4/vasprintf.m446
-rw-r--r--m4/vfprintf-posix.m4122
-rw-r--r--m4/xsize.m412
28 files changed, 0 insertions, 5831 deletions
diff --git a/m4/asm-underscore.m4 b/m4/asm-underscore.m4
deleted file mode 100644
index 65ae55a75fd..00000000000
--- a/m4/asm-underscore.m4
+++ /dev/null
@@ -1,83 +0,0 @@
-# asm-underscore.m4 serial 5
-dnl Copyright (C) 2010-2023 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 From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
-
-# gl_ASM_SYMBOL_PREFIX
-# Tests for the prefix of C symbols at the assembly language level and the
-# linker level. This prefix is either an underscore or empty. Defines the
-# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
-# a stringified variant of this prefix.
-
-AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
-[
- AC_REQUIRE([AC_PROG_EGREP])
- dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
- dnl 1. It works only for GCC.
- dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
- AC_REQUIRE([gl_C_ASM])
- AC_CACHE_CHECK(
- [whether C symbols are prefixed with underscore at the linker level],
- [gl_cv_prog_as_underscore],
- [cat > conftest.c <<EOF
-#ifdef __cplusplus
-extern "C" int foo (void);
-#endif
-int foo(void) { return 0; }
-EOF
- # Look for the assembly language name in the .s file.
- AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
- if LC_ALL=C $EGREP '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' conftest.$gl_asmext >/dev/null; then
- gl_cv_prog_as_underscore=yes
- else
- gl_cv_prog_as_underscore=no
- fi
- rm -f conftest*
- ])
- if test $gl_cv_prog_as_underscore = yes; then
- USER_LABEL_PREFIX=_
- else
- USER_LABEL_PREFIX=
- fi
- AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
- [Define to the prefix of C symbols at the assembler and linker level,
- either an underscore or empty.])
- ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
- AC_SUBST([ASM_SYMBOL_PREFIX])
-])
-
-# gl_C_ASM
-# Determines how to produce an assembly language file from C source code.
-# Sets the variables:
-# gl_asmext - the extension of assembly language output,
-# gl_c_asm_opt - the C compiler option that produces assembly language output.
-
-AC_DEFUN([gl_C_ASM],
-[
- AC_EGREP_CPP([MicrosoftCompiler],
- [
-#ifdef _MSC_VER
-MicrosoftCompiler
-#endif
- ],
- [dnl Microsoft's 'cl' and 'clang-cl' produce an .asm file, whereas 'clang'
- dnl produces a .s file. Need to distinguish 'clang' and 'clang-cl'.
- rm -f conftest*
- echo 'int dummy;' > conftest.c
- AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c) >/dev/null 2>&1
- if test -f conftest.o; then
- gl_asmext='s'
- gl_c_asm_opt='-S'
- else
- gl_asmext='asm'
- gl_c_asm_opt='-c -Fa'
- fi
- rm -f conftest*
- ],
- [gl_asmext='s'
- gl_c_asm_opt='-S'
- ])
-])
diff --git a/m4/exponentd.m4 b/m4/exponentd.m4
deleted file mode 100644
index 163114b89ec..00000000000
--- a/m4/exponentd.m4
+++ /dev/null
@@ -1,116 +0,0 @@
-# exponentd.m4 serial 4
-dnl Copyright (C) 2007-2008, 2010-2023 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.
-AC_DEFUN_ONCE([gl_DOUBLE_EXPONENT_LOCATION],
-[
- AC_CACHE_CHECK([where to find the exponent in a 'double'],
- [gl_cv_cc_double_expbit0],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
- ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { double value; unsigned int word[NWORDS]; } memory_double;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (double x)
-{
- memory_double m;
- size_t i;
- /* Clear it first, in case sizeof (double) < sizeof (memory_double). */
- memset (&m, 0, sizeof (memory_double));
- m.value = x;
- for (i = 0; i < NWORDS; i++)
- {
- ored_words[i] |= m.word[i];
- anded_words[i] &= m.word[i];
- }
-}
-int main ()
-{
- size_t j;
- FILE *fp = fopen ("conftest.out", "w");
- if (fp == NULL)
- return 1;
- for (j = 0; j < NWORDS; j++)
- anded_words[j] = ~ (unsigned int) 0;
- add_to_ored_words (0.25);
- add_to_ored_words (0.5);
- add_to_ored_words (1.0);
- add_to_ored_words (2.0);
- add_to_ored_words (4.0);
- /* Remove bits that are common (e.g. if representation of the first mantissa
- bit is explicit). */
- for (j = 0; j < NWORDS; j++)
- ored_words[j] &= ~anded_words[j];
- /* Now find the nonzero word. */
- for (j = 0; j < NWORDS; j++)
- if (ored_words[j] != 0)
- break;
- if (j < NWORDS)
- {
- size_t i;
- for (i = j + 1; i < NWORDS; i++)
- if (ored_words[i] != 0)
- {
- fprintf (fp, "unknown");
- return (fclose (fp) != 0);
- }
- for (i = 0; ; i++)
- if ((ored_words[j] >> i) & 1)
- {
- fprintf (fp, "word %d bit %d", (int) j, (int) i);
- return (fclose (fp) != 0);
- }
- }
- fprintf (fp, "unknown");
- return (fclose (fp) != 0);
-}
- ]])],
- [gl_cv_cc_double_expbit0=`cat conftest.out`],
- [gl_cv_cc_double_expbit0="unknown"],
- [
- dnl On ARM, there are two 'double' floating-point formats, used by
- dnl different sets of instructions: The older FPA instructions assume
- dnl that they are stored in big-endian word order, while the words
- dnl (like integer types) are stored in little-endian byte order.
- dnl The newer VFP instructions assume little-endian order
- dnl consistently.
- AC_EGREP_CPP([mixed_endianness], [
-#if defined arm || defined __arm || defined __arm__
- mixed_endianness
-#endif
- ],
- [gl_cv_cc_double_expbit0="unknown"],
- [
- pushdef([AC_MSG_CHECKING],[:])dnl
- pushdef([AC_MSG_RESULT],[:])dnl
- pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl
- AC_C_BIGENDIAN(
- [gl_cv_cc_double_expbit0="word 0 bit 20"],
- [gl_cv_cc_double_expbit0="word 1 bit 20"],
- [gl_cv_cc_double_expbit0="unknown"])
- popdef([AC_MSG_RESULT_UNQUOTED])dnl
- popdef([AC_MSG_RESULT])dnl
- popdef([AC_MSG_CHECKING])dnl
- ])
- ])
- rm -f conftest.out
- ])
- case "$gl_cv_cc_double_expbit0" in
- word*bit*)
- word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
- bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
- AC_DEFINE_UNQUOTED([DBL_EXPBIT0_WORD], [$word],
- [Define as the word index where to find the exponent of 'double'.])
- AC_DEFINE_UNQUOTED([DBL_EXPBIT0_BIT], [$bit],
- [Define as the bit index in the word where to find bit 0 of the exponent of 'double'.])
- ;;
- esac
-])
diff --git a/m4/exponentf.m4 b/m4/exponentf.m4
deleted file mode 100644
index e761883939b..00000000000
--- a/m4/exponentf.m4
+++ /dev/null
@@ -1,92 +0,0 @@
-# exponentf.m4 serial 3
-dnl Copyright (C) 2007-2008, 2010-2023 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.
-AC_DEFUN_ONCE([gl_FLOAT_EXPONENT_LOCATION],
-[
- AC_CACHE_CHECK([where to find the exponent in a 'float'],
- [gl_cv_cc_float_expbit0],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
- ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { float value; unsigned int word[NWORDS]; } memory_float;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (float x)
-{
- memory_float m;
- size_t i;
- /* Clear it first, in case
- sizeof (float) < sizeof (memory_float). */
- memset (&m, 0, sizeof (memory_float));
- m.value = x;
- for (i = 0; i < NWORDS; i++)
- {
- ored_words[i] |= m.word[i];
- anded_words[i] &= m.word[i];
- }
-}
-int main ()
-{
- size_t j;
- FILE *fp = fopen ("conftest.out", "w");
- if (fp == NULL)
- return 1;
- for (j = 0; j < NWORDS; j++)
- anded_words[j] = ~ (unsigned int) 0;
- add_to_ored_words (0.25f);
- add_to_ored_words (0.5f);
- add_to_ored_words (1.0f);
- add_to_ored_words (2.0f);
- add_to_ored_words (4.0f);
- /* Remove bits that are common (e.g. if representation of the first mantissa
- bit is explicit). */
- for (j = 0; j < NWORDS; j++)
- ored_words[j] &= ~anded_words[j];
- /* Now find the nonzero word. */
- for (j = 0; j < NWORDS; j++)
- if (ored_words[j] != 0)
- break;
- if (j < NWORDS)
- {
- size_t i;
- for (i = j + 1; i < NWORDS; i++)
- if (ored_words[i] != 0)
- {
- fprintf (fp, "unknown");
- return (fclose (fp) != 0);
- }
- for (i = 0; ; i++)
- if ((ored_words[j] >> i) & 1)
- {
- fprintf (fp, "word %d bit %d", (int) j, (int) i);
- return (fclose (fp) != 0);
- }
- }
- fprintf (fp, "unknown");
- return (fclose (fp) != 0);
-}
- ]])],
- [gl_cv_cc_float_expbit0=`cat conftest.out`],
- [gl_cv_cc_float_expbit0="unknown"],
- [gl_cv_cc_float_expbit0="word 0 bit 23"])
- rm -f conftest.out
- ])
- case "$gl_cv_cc_float_expbit0" in
- word*bit*)
- word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
- bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
- AC_DEFINE_UNQUOTED([FLT_EXPBIT0_WORD], [$word],
- [Define as the word index where to find the exponent of 'float'.])
- AC_DEFINE_UNQUOTED([FLT_EXPBIT0_BIT], [$bit],
- [Define as the bit index in the word where to find bit 0 of the exponent of 'float'.])
- ;;
- esac
-])
diff --git a/m4/exponentl.m4 b/m4/exponentl.m4
deleted file mode 100644
index bc5638737e5..00000000000
--- a/m4/exponentl.m4
+++ /dev/null
@@ -1,112 +0,0 @@
-# exponentl.m4 serial 6
-dnl Copyright (C) 2007-2023 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.
-AC_DEFUN_ONCE([gl_LONG_DOUBLE_EXPONENT_LOCATION],
-[
- AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([where to find the exponent in a 'long double'],
- [gl_cv_cc_long_double_expbit0],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
- ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { long double value; unsigned int word[NWORDS]; }
- memory_long_double;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (long double *x)
-{
- memory_long_double m;
- size_t i;
- /* Clear it first, in case
- sizeof (long double) < sizeof (memory_long_double). */
- memset (&m, 0, sizeof (memory_long_double));
- m.value = *x;
- for (i = 0; i < NWORDS; i++)
- {
- ored_words[i] |= m.word[i];
- anded_words[i] &= m.word[i];
- }
-}
-int main ()
-{
- static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L };
- size_t j;
- FILE *fp = fopen ("conftest.out", "w");
- if (fp == NULL)
- return 1;
- for (j = 0; j < NWORDS; j++)
- anded_words[j] = ~ (unsigned int) 0;
- for (j = 0; j < 5; j++)
- add_to_ored_words (&samples[j]);
- /* Remove bits that are common (e.g. if representation of the first mantissa
- bit is explicit). */
- for (j = 0; j < NWORDS; j++)
- ored_words[j] &= ~anded_words[j];
- /* Now find the nonzero word. */
- for (j = 0; j < NWORDS; j++)
- if (ored_words[j] != 0)
- break;
- if (j < NWORDS)
- {
- size_t i;
- for (i = j + 1; i < NWORDS; i++)
- if (ored_words[i] != 0)
- {
- fprintf (fp, "unknown");
- return (fclose (fp) != 0);
- }
- for (i = 0; ; i++)
- if ((ored_words[j] >> i) & 1)
- {
- fprintf (fp, "word %d bit %d", (int) j, (int) i);
- return (fclose (fp) != 0);
- }
- }
- fprintf (fp, "unknown");
- return (fclose (fp) != 0);
-}
- ]])],
- [gl_cv_cc_long_double_expbit0=`cat conftest.out`],
- [gl_cv_cc_long_double_expbit0="unknown"],
- [
- dnl When cross-compiling, in general we don't know. It depends on the
- dnl ABI and compiler version. There are too many cases.
- gl_cv_cc_long_double_expbit0="unknown"
- case "$host_os" in
- mingw*) # On native Windows (little-endian), we know the result
- # in two cases: mingw, MSVC.
- AC_EGREP_CPP([Known], [
-#ifdef __MINGW32__
- Known
-#endif
- ], [gl_cv_cc_long_double_expbit0="word 2 bit 0"])
- AC_EGREP_CPP([Known], [
-#ifdef _MSC_VER
- Known
-#endif
- ], [gl_cv_cc_long_double_expbit0="word 1 bit 20"])
- ;;
- esac
- ])
- rm -f conftest.out
- ])
- case "$gl_cv_cc_long_double_expbit0" in
- word*bit*)
- word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
- bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
- AC_DEFINE_UNQUOTED([LDBL_EXPBIT0_WORD], [$word],
- [Define as the word index where to find the exponent of 'long double'.])
- AC_DEFINE_UNQUOTED([LDBL_EXPBIT0_BIT], [$bit],
- [Define as the bit index in the word where to find bit 0 of the exponent of 'long double'.])
- ;;
- esac
-])
diff --git a/m4/float_h.m4 b/m4/float_h.m4
deleted file mode 100644
index 2f0c9c4ee9c..00000000000
--- a/m4/float_h.m4
+++ /dev/null
@@ -1,106 +0,0 @@
-# float_h.m4 serial 13
-dnl Copyright (C) 2007, 2009-2023 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.
-
-AC_DEFUN([gl_FLOAT_H],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST])
- GL_GENERATE_FLOAT_H=false
- REPLACE_FLOAT_LDBL=0
- case "$host_os" in
- aix* | beos* | openbsd* | mirbsd* | irix*)
- GL_GENERATE_FLOAT_H=true
- ;;
- freebsd* | dragonfly*)
- case "$host_cpu" in
-changequote(,)dnl
- i[34567]86 )
-changequote([,])dnl
- GL_GENERATE_FLOAT_H=true
- ;;
- x86_64 )
- # On x86_64 systems, the C compiler may still be generating
- # 32-bit code.
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined __LP64__ || defined __x86_64__ || defined __amd64__
- int ok;
- #else
- error fail
- #endif
- ]])],
- [],
- [GL_GENERATE_FLOAT_H=true])
- ;;
- esac
- ;;
- linux*)
- case "$host_cpu" in
- powerpc*)
- GL_GENERATE_FLOAT_H=true
- ;;
- esac
- ;;
- esac
- case "$host_os" in
- aix* | freebsd* | dragonfly* | linux*)
- if $GL_GENERATE_FLOAT_H; then
- REPLACE_FLOAT_LDBL=1
- fi
- ;;
- esac
-
- dnl Test against glibc-2.7 Linux/SPARC64 bug.
- REPLACE_ITOLD=0
- AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
- [gl_cv_func_itold_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-int i = -1;
-volatile long double ld;
-int main ()
-{
- ld += i * 1.0L;
- if (ld > 0)
- return 1;
- return 0;
-}]])],
- [gl_cv_func_itold_works=yes],
- [gl_cv_func_itold_works=no],
- [case "$host" in
- sparc*-*-linux*)
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if defined __LP64__ || defined __arch64__
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_func_itold_works="guessing no"],
- [gl_cv_func_itold_works="guessing yes"])
- ;;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_itold_works="guessing yes" ;;
- *) gl_cv_func_itold_works="guessing yes" ;;
- esac
- ])
- ])
- case "$gl_cv_func_itold_works" in
- *no)
- REPLACE_ITOLD=1
- dnl We add the workaround to <float.h> but also to <math.h>,
- dnl to increase the chances that the fix function gets pulled in.
- GL_GENERATE_FLOAT_H=true
- ;;
- esac
-
- if $GL_GENERATE_FLOAT_H; then
- gl_NEXT_HEADERS([float.h])
- fi
- AC_SUBST([REPLACE_ITOLD])
-])
diff --git a/m4/frexp.m4 b/m4/frexp.m4
deleted file mode 100644
index 0480d98f304..00000000000
--- a/m4/frexp.m4
+++ /dev/null
@@ -1,181 +0,0 @@
-# frexp.m4 serial 16
-dnl Copyright (C) 2007-2023 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.
-
-AC_DEFUN([gl_FUNC_FREXP],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM])
- FREXP_LIBM=
- if test $gl_cv_func_frexp_no_libm = no; then
- AC_CACHE_CHECK([whether frexp() can be used with libm],
- [gl_cv_func_frexp_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- double x;]],
- [[int e; return frexp (x, &e) > 0;]])],
- [gl_cv_func_frexp_in_libm=yes],
- [gl_cv_func_frexp_in_libm=no])
- LIBS="$save_LIBS"
- ])
- if test $gl_cv_func_frexp_in_libm = yes; then
- FREXP_LIBM=-lm
- fi
- fi
- if test $gl_cv_func_frexp_no_libm = yes \
- || test $gl_cv_func_frexp_in_libm = yes; then
- save_LIBS="$LIBS"
- LIBS="$LIBS $FREXP_LIBM"
- gl_FUNC_FREXP_WORKS
- LIBS="$save_LIBS"
- case "$gl_cv_func_frexp_works" in
- *yes) gl_func_frexp=yes ;;
- *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;;
- esac
- else
- gl_func_frexp=no
- fi
- if test $gl_func_frexp = yes; then
- AC_DEFINE([HAVE_FREXP], [1],
- [Define if the frexp() function is available and works.])
- fi
- AC_SUBST([FREXP_LIBM])
-])
-
-AC_DEFUN([gl_FUNC_FREXP_NO_LIBM],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM])
- if test $gl_cv_func_frexp_no_libm = yes; then
- gl_FUNC_FREXP_WORKS
- case "$gl_cv_func_frexp_works" in
- *yes) gl_func_frexp_no_libm=yes ;;
- *) gl_func_frexp_no_libm=no; REPLACE_FREXP=1 ;;
- esac
- else
- gl_func_frexp_no_libm=no
- dnl Set REPLACE_FREXP here because the system may have frexp in libm.
- REPLACE_FREXP=1
- fi
- if test $gl_func_frexp_no_libm = yes; then
- AC_DEFINE([HAVE_FREXP_IN_LIBC], [1],
- [Define if the frexp() function is available in libc.])
- fi
-])
-
-dnl Test whether frexp() can be used without linking with libm.
-dnl Set gl_cv_func_frexp_no_libm to 'yes' or 'no' accordingly.
-AC_DEFUN([gl_CHECK_FREXP_NO_LIBM],
-[
- AC_CACHE_CHECK([whether frexp() can be used without linking with libm],
- [gl_cv_func_frexp_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- double x;]],
- [[int e; return frexp (x, &e) > 0;]])],
- [gl_cv_func_frexp_no_libm=yes],
- [gl_cv_func_frexp_no_libm=no])
- ])
-])
-
-dnl Test whether frexp() works also on denormalized numbers (this fails e.g. on
-dnl NetBSD 3.0), on infinite numbers (this fails e.g. on IRIX 6.5 and mingw),
-dnl and on negative zero (this fails e.g. on NetBSD 4.99 and mingw).
-AC_DEFUN([gl_FUNC_FREXP_WORKS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CHECK_DECLS_ONCE([alarm])
- AC_CACHE_CHECK([whether frexp works], [gl_cv_func_frexp_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <float.h>
-#include <math.h>
-#include <string.h>
-#if HAVE_DECL_ALARM
-# include <signal.h>
-# include <unistd.h>
-#endif
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
- ICC 10.0 has a bug when optimizing the expression -zero.
- The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
- to PowerPC on Mac OS X 10.5. */
-#if defined __hpux || defined __sgi || defined __ICC
-static double
-compute_minus_zero (void)
-{
- return -DBL_MIN * DBL_MIN;
-}
-# define minus_zero compute_minus_zero ()
-#else
-double minus_zero = -0.0;
-#endif
-int main()
-{
- int result = 0;
- int i;
- volatile double x;
- double zero = 0.0;
-#if HAVE_DECL_ALARM
- /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
- number. Let the test fail in this case. */
- signal (SIGALRM, SIG_DFL);
- alarm (5);
-#endif
- /* Test on denormalized numbers. */
- for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
- ;
- if (x > 0.0)
- {
- int exp;
- double y = frexp (x, &exp);
- /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
- On NetBSD: y = 0.75. Correct: y = 0.5. */
- if (y != 0.5)
- result |= 1;
- }
- /* Test on infinite numbers. */
- x = 1.0 / zero;
- {
- int exp;
- double y = frexp (x, &exp);
- if (y != x)
- result |= 2;
- }
- /* Test on negative zero. */
- x = minus_zero;
- {
- int exp;
- double y = frexp (x, &exp);
- if (memcmp (&y, &x, sizeof x))
- result |= 4;
- }
- return result;
-}]])],
- [gl_cv_func_frexp_works=yes],
- [gl_cv_func_frexp_works=no],
- [case "$host_os" in
- netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
- mingw*) # Guess yes with MSVC, no with mingw.
- AC_EGREP_CPP([Good], [
-#ifdef _MSC_VER
- Good
-#endif
- ],
- [gl_cv_func_frexp_works="guessing yes"],
- [gl_cv_func_frexp_works="guessing no"])
- ;;
- *) gl_cv_func_frexp_works="guessing yes" ;;
- esac
- ])
- ])
-])
diff --git a/m4/frexpl.m4 b/m4/frexpl.m4
deleted file mode 100644
index b4cf0ca9ea1..00000000000
--- a/m4/frexpl.m4
+++ /dev/null
@@ -1,233 +0,0 @@
-# frexpl.m4 serial 22
-dnl Copyright (C) 2007-2023 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.
-
-AC_DEFUN([gl_FUNC_FREXPL],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
-
- dnl Persuade glibc <math.h> to declare frexpl().
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
- dnl Check whether it's declared.
- dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
-
- FREXPL_LIBM=
- if test $HAVE_DECL_FREXPL = 1; then
- gl_CHECK_FREXPL_NO_LIBM
- if test $gl_cv_func_frexpl_no_libm = no; then
- AC_CACHE_CHECK([whether frexpl() can be used with libm],
- [gl_cv_func_frexpl_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x;]],
- [[int e; return frexpl (x, &e) > 0;]])],
- [gl_cv_func_frexpl_in_libm=yes],
- [gl_cv_func_frexpl_in_libm=no])
- LIBS="$save_LIBS"
- ])
- if test $gl_cv_func_frexpl_in_libm = yes; then
- FREXPL_LIBM=-lm
- fi
- fi
- if test $gl_cv_func_frexpl_no_libm = yes \
- || test $gl_cv_func_frexpl_in_libm = yes; then
- save_LIBS="$LIBS"
- LIBS="$LIBS $FREXPL_LIBM"
- gl_FUNC_FREXPL_WORKS
- LIBS="$save_LIBS"
- case "$gl_cv_func_frexpl_works" in
- *yes) gl_func_frexpl=yes ;;
- *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;;
- esac
- else
- gl_func_frexpl=no
- fi
- if test $gl_func_frexpl = yes; then
- AC_DEFINE([HAVE_FREXPL], [1],
- [Define if the frexpl() function is available.])
- fi
- fi
- if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
- dnl Find libraries needed to link lib/frexpl.c.
- if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
- AC_REQUIRE([gl_FUNC_FREXP])
- FREXPL_LIBM="$FREXP_LIBM"
- else
- FREXPL_LIBM=
- fi
- fi
- AC_SUBST([FREXPL_LIBM])
-])
-
-AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
- dnl Check whether it's declared.
- dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
- if test $HAVE_DECL_FREXPL = 1; then
- gl_CHECK_FREXPL_NO_LIBM
- if test $gl_cv_func_frexpl_no_libm = yes; then
- gl_FUNC_FREXPL_WORKS
- case "$gl_cv_func_frexpl_works" in
- *yes) gl_func_frexpl_no_libm=yes ;;
- *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
- esac
- else
- gl_func_frexpl_no_libm=no
- dnl Set REPLACE_FREXPL here because the system may have frexpl in libm.
- REPLACE_FREXPL=1
- fi
- if test $gl_func_frexpl_no_libm = yes; then
- AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1],
- [Define if the frexpl() function is available in libc.])
- fi
- fi
-])
-
-dnl Test whether frexpl() can be used without linking with libm.
-dnl Set gl_cv_func_frexpl_no_libm to 'yes' or 'no' accordingly.
-AC_DEFUN([gl_CHECK_FREXPL_NO_LIBM],
-[
- AC_CACHE_CHECK([whether frexpl() can be used without linking with libm],
- [gl_cv_func_frexpl_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x;]],
- [[int e; return frexpl (x, &e) > 0;]])],
- [gl_cv_func_frexpl_no_libm=yes],
- [gl_cv_func_frexpl_no_libm=no])
- ])
-])
-
-dnl Test whether frexpl() works on finite numbers (this fails on
-dnl Mac OS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers
-dnl (this fails on Mac OS X 10.5/i386), and also on infinite numbers (this
-dnl fails e.g. on IRIX 6.5 and mingw).
-AC_DEFUN([gl_FUNC_FREXPL_WORKS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether frexpl works], [gl_cv_func_frexpl_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <float.h>
-#include <math.h>
-/* Override the values of <float.h>, like done in float.in.h. */
-#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP (-16381)
-#endif
-#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP (-16381)
-#endif
-#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP DBL_MIN_EXP
-#endif
-#if defined __sgi && (LDBL_MANT_DIG >= 106)
-# if defined __GNUC__
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP DBL_MIN_EXP
-# endif
-#endif
-extern
-#ifdef __cplusplus
-"C"
-#endif
-long double frexpl (long double, int *);
-long double zero = 0.0L;
-int main()
-{
- int result = 0;
- volatile long double x;
- /* Test on finite numbers that fails on AIX 5.1. */
- x = 16.0L;
- {
- int exp = -9999;
- frexpl (x, &exp);
- if (exp != 5)
- result |= 1;
- }
- /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
- function returns an invalid (incorrectly normalized) value: it returns
- y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
- but the correct result is
- 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */
- x = 1.01L;
- {
- int exp = -9999;
- long double y = frexpl (x, &exp);
- if (!(exp == 1 && y == 0.505L))
- result |= 2;
- }
- /* Test on large finite numbers. This fails on BeOS at i = 16322, while
- LDBL_MAX_EXP = 16384.
- In the loop end test, we test x against Infinity, rather than comparing
- i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */
- {
- int i;
- for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
- {
- int exp = -9999;
- frexpl (x, &exp);
- if (exp != i)
- {
- result |= 4;
- break;
- }
- }
- }
- /* Test on denormalized numbers. */
- {
- int i;
- for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
- ;
- if (x > 0.0L)
- {
- int exp;
- long double y = frexpl (x, &exp);
- /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
- exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */
- if (exp != LDBL_MIN_EXP - 1)
- result |= 8;
- }
- }
- /* Test on infinite numbers. */
- /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0. */
- x = 1.0L / zero;
- {
- int exp;
- long double y = frexpl (x, &exp);
- if (y != x)
- result |= 16;
- }
- return result;
-}]])],
- [gl_cv_func_frexpl_works=yes],
- [gl_cv_func_frexpl_works=no],
- [
-changequote(,)dnl
- case "$host_os" in
- aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
- gl_cv_func_frexpl_works="guessing no";;
- *) gl_cv_func_frexpl_works="guessing yes";;
- esac
-changequote([,])dnl
- ])
- ])
-])
diff --git a/m4/fseterr.m4 b/m4/fseterr.m4
deleted file mode 100644
index 61ac03d49d1..00000000000
--- a/m4/fseterr.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-# fseterr.m4 serial 2
-dnl Copyright (C) 2012-2023 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.
-
-AC_DEFUN([gl_FUNC_FSETERR],
-[
- gl_CHECK_FUNCS_ANDROID([__fseterr],
- [[#include <stdio.h>
- #include <stdio_ext.h>
- ]])
-])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 4c1e41daf51..72adcf90d5e 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -95,15 +95,10 @@ AC_DEFUN([gl_EARLY],
# Code from module filename:
# Code from module filevercmp:
# Code from module flexmember:
- # Code from module float:
# Code from module fpending:
# Code from module fpieee:
AC_REQUIRE([gl_FP_IEEE])
- # Code from module fpucw:
# Code from module free-posix:
- # Code from module frexp-nolibm:
- # Code from module frexpl-nolibm:
- # Code from module fseterr:
# Code from module fstatat:
# Code from module fsusage:
# Code from module fsync:
@@ -130,9 +125,6 @@ AC_DEFUN([gl_EARLY],
# Code from module include_next:
# Code from module intprops:
# Code from module inttypes-incomplete:
- # Code from module isnand-nolibm:
- # Code from module isnanf-nolibm:
- # Code from module isnanl-nolibm:
# Code from module largefile:
AC_REQUIRE([AC_SYS_LARGEFILE])
# Code from module lchmod:
@@ -143,7 +135,6 @@ AC_DEFUN([gl_EARLY],
# Code from module malloc-gnu:
# Code from module malloc-posix:
# Code from module manywarnings:
- # Code from module math:
# Code from module memmem-simple:
# Code from module mempcpy:
# Code from module memrchr:
@@ -161,10 +152,6 @@ AC_DEFUN([gl_EARLY],
# Code from module openat-h:
# Code from module pathmax:
# Code from module pipe2:
- # Code from module printf-frexp:
- # Code from module printf-frexpl:
- # Code from module printf-posix:
- # Code from module printf-safe:
# Code from module pselect:
# Code from module pthread_sigmask:
# Code from module qcopy-acl:
@@ -178,8 +165,6 @@ AC_DEFUN([gl_EARLY],
# Code from module sig2str:
# Code from module sigdescr_np:
# Code from module signal-h:
- # Code from module signbit:
- # Code from module size_max:
# Code from module snippet/_Noreturn:
# Code from module snippet/arg-nonnull:
# Code from module snippet/c++defs:
@@ -224,15 +209,10 @@ AC_DEFUN([gl_EARLY],
# Code from module utimens:
# Code from module utimensat:
# Code from module vararrays:
- # Code from module vasnprintf:
- # Code from module vasprintf:
- # Code from module vasprintf-posix:
# Code from module verify:
- # Code from module vfprintf-posix:
# Code from module vla:
# Code from module warnings:
# Code from module xalloc-oversized:
- # Code from module xsize:
# Code from module year2038:
AC_REQUIRE([AC_SYS_YEAR2038])
])
@@ -342,11 +322,6 @@ AC_DEFUN([gl_INIT],
gl_FILE_HAS_ACL
gl_FILEMODE
AC_C_FLEXIBLE_ARRAY_MEMBER
- gl_FLOAT_H
- gl_CONDITIONAL_HEADER([float.h])
- AC_PROG_MKDIR_P
- gl_CONDITIONAL([GL_COND_OBJ_FLOAT], [test $REPLACE_FLOAT_LDBL = 1])
- gl_CONDITIONAL([GL_COND_OBJ_ITOLD], [test $REPLACE_ITOLD = 1])
gl_FUNC_FPENDING
gl_CONDITIONAL([GL_COND_OBJ_FPENDING], [test $gl_cv_func___fpending = no])
gl_FUNC_FREE
@@ -355,16 +330,6 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_FREE
])
gl_STDLIB_MODULE_INDICATOR([free-posix])
- gl_FUNC_FREXP_NO_LIBM
- if test $gl_func_frexp_no_libm != yes; then
- AC_LIBOBJ([frexp])
- fi
- gl_MATH_MODULE_INDICATOR([frexp])
- gl_FUNC_FREXPL_NO_LIBM
- if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then
- AC_LIBOBJ([frexpl])
- fi
- gl_MATH_MODULE_INDICATOR([frexpl])
gl_FUNC_FSTATAT
gl_CONDITIONAL([GL_COND_OBJ_FSTATAT],
[test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1])
@@ -432,16 +397,6 @@ AC_DEFUN([gl_INIT],
gl_INTTYPES_INCOMPLETE
gl_INTTYPES_H_REQUIRE_DEFAULTS
AC_PROG_MKDIR_P
- gl_FUNC_ISNAND_NO_LIBM
- if test $gl_func_isnand_no_libm != yes; then
- AC_LIBOBJ([isnand])
- gl_PREREQ_ISNAND
- fi
- gl_FUNC_ISNANL_NO_LIBM
- if test $gl_func_isnanl_no_libm != yes; then
- AC_LIBOBJ([isnanl])
- gl_PREREQ_ISNANL
- fi
AC_REQUIRE([gl_LARGEFILE])
gl___INLINE
gl_LIBGMP
@@ -457,9 +412,6 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_LSTAT
])
gl_SYS_STAT_MODULE_INDICATOR([lstat])
- gl_MATH_H
- gl_MATH_H_REQUIRE_DEFAULTS
- AC_PROG_MKDIR_P
gl_FUNC_MEMMEM_SIMPLE
if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
AC_LIBOBJ([memmem])
@@ -509,11 +461,6 @@ AC_DEFUN([gl_INIT],
gl_PATHMAX
gl_FUNC_PIPE2
gl_UNISTD_MODULE_INDICATOR([pipe2])
- gl_FUNC_PRINTF_FREXP
- gl_FUNC_PRINTF_FREXPL
- gl_FUNC_PRINTF_POSIX
- gl_STDIO_MODULE_INDICATOR([printf-posix])
- m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes])
gl_FUNC_PSELECT
gl_CONDITIONAL([GL_COND_OBJ_PSELECT],
[test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1])
@@ -560,9 +507,6 @@ AC_DEFUN([gl_INIT],
gl_SIGNAL_H
gl_SIGNAL_H_REQUIRE_DEFAULTS
AC_PROG_MKDIR_P
- gl_SIGNBIT
- gl_CONDITIONAL([GL_COND_OBJ_SIGNBIT3], [test $REPLACE_SIGNBIT = 1])
- gl_MATH_MODULE_INDICATOR([signbit])
gl_TYPE_SOCKLEN_T
gt_TYPE_SSIZE_T
gl_STAT_TIME
@@ -709,18 +653,11 @@ AC_DEFUN([gl_INIT],
[test $HAVE_UTIMENSAT = 0 || test $REPLACE_UTIMENSAT = 1])
gl_SYS_STAT_MODULE_INDICATOR([utimensat])
AC_C_VARARRAYS
- gl_FUNC_VASPRINTF
- gl_STDIO_MODULE_INDICATOR([vasprintf])
- m4_ifdef([AM_XGETTEXT_OPTION],
- [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format])
- AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
- gl_FUNC_VASPRINTF_POSIX
gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false
gl_gnulib_enabled_cloexec=false
gl_gnulib_enabled_dirfd=false
gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c=false
gl_gnulib_enabled_euidaccess=false
- gl_gnulib_enabled_fseterr=false
gl_gnulib_enabled_getdelim=false
gl_gnulib_enabled_getdtablesize=false
gl_gnulib_enabled_getgroups=false
@@ -728,7 +665,6 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_fd38c7e463b54744b77b98aeafb4fa7c=false
gl_gnulib_enabled_8444034ea779b88768865bb60b4fb8c9=false
gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false
- gl_gnulib_enabled_3f0e593033d1fc2c127581960f641b66=false
gl_gnulib_enabled_lchmod=false
gl_gnulib_enabled_e80bf6f757095d2e5fc94dafb8f8fc8b=false
gl_gnulib_enabled_ef455225c00f5049c808c2eda3e76866=false
@@ -739,13 +675,9 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_d3b2383720ee0e541357aa2aac598e2b=false
gl_gnulib_enabled_61bcaca76b3e6f9ae55d57a1c3193bc4=false
gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
- gl_gnulib_enabled_size_max=false
gl_gnulib_enabled_strtoll=false
gl_gnulib_enabled_utimens=false
- gl_gnulib_enabled_vasnprintf=false
- gl_gnulib_enabled_ed5616be3593d355b981ffab56b9f37b=false
gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false
- gl_gnulib_enabled_xsize=false
func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b ()
{
if $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then :; else
@@ -798,14 +730,6 @@ AC_DEFUN([gl_INIT],
func_gl_gnulib_m4code_6099e9737f757db36c47fa9d9f02e88c
fi
}
- func_gl_gnulib_m4code_fseterr ()
- {
- if $gl_gnulib_enabled_fseterr; then :; else
- gl_FUNC_FSETERR
- gl_CONDITIONAL([GL_COND_OBJ_FSETERR], [test $ac_cv_func___fseterr = no])
- gl_gnulib_enabled_fseterr=true
- fi
- }
func_gl_gnulib_m4code_getdelim ()
{
if $gl_gnulib_enabled_getdelim; then :; else
@@ -887,17 +811,6 @@ AC_DEFUN([gl_INIT],
fi
fi
}
- func_gl_gnulib_m4code_3f0e593033d1fc2c127581960f641b66 ()
- {
- if $gl_gnulib_enabled_3f0e593033d1fc2c127581960f641b66; then :; else
- gl_FUNC_ISNANF_NO_LIBM
- if test $gl_func_isnanf_no_libm != yes; then
- AC_LIBOBJ([isnanf])
- gl_PREREQ_ISNANF
- fi
- gl_gnulib_enabled_3f0e593033d1fc2c127581960f641b66=true
- fi
- }
func_gl_gnulib_m4code_lchmod ()
{
if $gl_gnulib_enabled_lchmod; then :; else
@@ -1024,13 +937,6 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=true
fi
}
- func_gl_gnulib_m4code_size_max ()
- {
- if $gl_gnulib_enabled_size_max; then :; else
- gl_SIZE_MAX
- gl_gnulib_enabled_size_max=true
- fi
- }
func_gl_gnulib_m4code_strtoll ()
{
if $gl_gnulib_enabled_strtoll; then :; else
@@ -1051,44 +957,12 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_utimens=true
fi
}
- func_gl_gnulib_m4code_vasnprintf ()
- {
- if $gl_gnulib_enabled_vasnprintf; then :; else
- AC_REQUIRE([AC_C_RESTRICT])
- gl_FUNC_VASNPRINTF
- gl_gnulib_enabled_vasnprintf=true
- func_gl_gnulib_m4code_xsize
- fi
- }
- func_gl_gnulib_m4code_ed5616be3593d355b981ffab56b9f37b ()
- {
- if $gl_gnulib_enabled_ed5616be3593d355b981ffab56b9f37b; then :; else
- gl_FUNC_VFPRINTF_POSIX
- gl_STDIO_MODULE_INDICATOR([vfprintf-posix])
- gl_MODULE_INDICATOR([vfprintf-posix])
- gl_gnulib_enabled_ed5616be3593d355b981ffab56b9f37b=true
- if test $REPLACE_VFPRINTF = 1; then
- func_gl_gnulib_m4code_fseterr
- fi
- if test $REPLACE_VFPRINTF = 1; then
- func_gl_gnulib_m4code_vasnprintf
- fi
- fi
- }
func_gl_gnulib_m4code_682e609604ccaac6be382e4ee3a4eaec ()
{
if $gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec; then :; else
gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=true
fi
}
- func_gl_gnulib_m4code_xsize ()
- {
- if $gl_gnulib_enabled_xsize; then :; else
- gl_XSIZE
- gl_gnulib_enabled_xsize=true
- func_gl_gnulib_m4code_size_max
- fi
- }
if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
func_gl_gnulib_m4code_925677f0343de64b89a9f0c790b4104c
fi
@@ -1146,9 +1020,6 @@ AC_DEFUN([gl_INIT],
if case $host_os in mingw*) false;; *) test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1;; esac; then
func_gl_gnulib_m4code_open
fi
- if test $REPLACE_PRINTF = 1; then
- func_gl_gnulib_m4code_ed5616be3593d355b981ffab56b9f37b
- fi
if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then
func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
fi
@@ -1158,9 +1029,6 @@ AC_DEFUN([gl_INIT],
if test $ac_use_included_regex = yes; then
func_gl_gnulib_m4code_fd38c7e463b54744b77b98aeafb4fa7c
fi
- if test $REPLACE_SIGNBIT = 1; then
- func_gl_gnulib_m4code_3f0e593033d1fc2c127581960f641b66
- fi
if { test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes; then
func_gl_gnulib_m4code_strtoll
fi
@@ -1176,19 +1044,12 @@ AC_DEFUN([gl_INIT],
if test $HAVE_UTIMENSAT = 0 || test $REPLACE_UTIMENSAT = 1; then
func_gl_gnulib_m4code_utimens
fi
- if test $HAVE_VASPRINTF = 0 || test $REPLACE_VASPRINTF = 1; then
- func_gl_gnulib_m4code_vasnprintf
- fi
- if test $HAVE_VASPRINTF = 0 || test $REPLACE_VASPRINTF = 1; then
- func_gl_gnulib_m4code_vasnprintf
- fi
m4_pattern_allow([^gl_GNULIB_ENABLED_])
AM_CONDITIONAL([gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b], [$gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b])
AM_CONDITIONAL([gl_GNULIB_ENABLED_cloexec], [$gl_gnulib_enabled_cloexec])
AM_CONDITIONAL([gl_GNULIB_ENABLED_dirfd], [$gl_gnulib_enabled_dirfd])
AM_CONDITIONAL([gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c], [$gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c])
AM_CONDITIONAL([gl_GNULIB_ENABLED_euidaccess], [$gl_gnulib_enabled_euidaccess])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_fseterr], [$gl_gnulib_enabled_fseterr])
AM_CONDITIONAL([gl_GNULIB_ENABLED_getdelim], [$gl_gnulib_enabled_getdelim])
AM_CONDITIONAL([gl_GNULIB_ENABLED_getdtablesize], [$gl_gnulib_enabled_getdtablesize])
AM_CONDITIONAL([gl_GNULIB_ENABLED_getgroups], [$gl_gnulib_enabled_getgroups])
@@ -1196,7 +1057,6 @@ AC_DEFUN([gl_INIT],
AM_CONDITIONAL([gl_GNULIB_ENABLED_fd38c7e463b54744b77b98aeafb4fa7c], [$gl_gnulib_enabled_fd38c7e463b54744b77b98aeafb4fa7c])
AM_CONDITIONAL([gl_GNULIB_ENABLED_8444034ea779b88768865bb60b4fb8c9], [$gl_gnulib_enabled_8444034ea779b88768865bb60b4fb8c9])
AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_3f0e593033d1fc2c127581960f641b66], [$gl_gnulib_enabled_3f0e593033d1fc2c127581960f641b66])
AM_CONDITIONAL([gl_GNULIB_ENABLED_lchmod], [$gl_gnulib_enabled_lchmod])
AM_CONDITIONAL([gl_GNULIB_ENABLED_e80bf6f757095d2e5fc94dafb8f8fc8b], [$gl_gnulib_enabled_e80bf6f757095d2e5fc94dafb8f8fc8b])
AM_CONDITIONAL([gl_GNULIB_ENABLED_ef455225c00f5049c808c2eda3e76866], [$gl_gnulib_enabled_ef455225c00f5049c808c2eda3e76866])
@@ -1207,13 +1067,9 @@ AC_DEFUN([gl_INIT],
AM_CONDITIONAL([gl_GNULIB_ENABLED_d3b2383720ee0e541357aa2aac598e2b], [$gl_gnulib_enabled_d3b2383720ee0e541357aa2aac598e2b])
AM_CONDITIONAL([gl_GNULIB_ENABLED_61bcaca76b3e6f9ae55d57a1c3193bc4], [$gl_gnulib_enabled_61bcaca76b3e6f9ae55d57a1c3193bc4])
AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_size_max], [$gl_gnulib_enabled_size_max])
AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll])
AM_CONDITIONAL([gl_GNULIB_ENABLED_utimens], [$gl_gnulib_enabled_utimens])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_vasnprintf], [$gl_gnulib_enabled_vasnprintf])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_ed5616be3593d355b981ffab56b9f37b], [$gl_gnulib_enabled_ed5616be3593d355b981ffab56b9f37b])
AM_CONDITIONAL([gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec], [$gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_xsize], [$gl_gnulib_enabled_xsize])
# End of code from modules
m4_ifval(gl_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
@@ -1399,8 +1255,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/allocator.c
lib/allocator.h
lib/arg-nonnull.h
- lib/asnprintf.c
- lib/asprintf.c
lib/assert.in.h
lib/at-func.c
lib/attribute.h
@@ -1453,17 +1307,9 @@ AC_DEFUN([gl_FILE_LIST], [
lib/filevercmp.c
lib/filevercmp.h
lib/flexmember.h
- lib/float+.h
- lib/float.c
- lib/float.in.h
lib/fpending.c
lib/fpending.h
- lib/fpucw.h
lib/free.c
- lib/frexp.c
- lib/frexpl.c
- lib/fseterr.c
- lib/fseterr.h
lib/fstatat.c
lib/fsusage.c
lib/fsusage.h
@@ -1498,14 +1344,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/intprops-internal.h
lib/intprops.h
lib/inttypes.in.h
- lib/isnan.c
- lib/isnand-nolibm.h
- lib/isnand.c
- lib/isnanf-nolibm.h
- lib/isnanf.c
- lib/isnanl-nolibm.h
- lib/isnanl.c
- lib/itold.c
lib/lchmod.c
lib/libc-config.h
lib/limits.in.h
@@ -1522,8 +1360,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/malloc/scratch_buffer_grow.c
lib/malloc/scratch_buffer_grow_preserve.c
lib/malloc/scratch_buffer_set_array_size.c
- lib/math.c
- lib/math.in.h
lib/md5-stream.c
lib/md5.c
lib/md5.h
@@ -1548,15 +1384,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/openat.h
lib/pathmax.h
lib/pipe2.c
- lib/printf-args.c
- lib/printf-args.h
- lib/printf-frexp.c
- lib/printf-frexp.h
- lib/printf-frexpl.c
- lib/printf-frexpl.h
- lib/printf-parse.c
- lib/printf-parse.h
- lib/printf.c
lib/pselect.c
lib/pthread_sigmask.c
lib/qcopy-acl.c
@@ -1584,10 +1411,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/sig2str.h
lib/sigdescr_np.c
lib/signal.in.h
- lib/signbitd.c
- lib/signbitf.c
- lib/signbitl.c
- lib/size_max.h
lib/stat-time.c
lib/stat-time.h
lib/stdckdint.in.h
@@ -1632,22 +1455,15 @@ AC_DEFUN([gl_FILE_LIST], [
lib/utimens.c
lib/utimens.h
lib/utimensat.c
- lib/vasnprintf.c
- lib/vasnprintf.h
- lib/vasprintf.c
lib/verify.h
- lib/vfprintf.c
lib/vla.h
lib/warn-on-use.h
lib/xalloc-oversized.h
- lib/xsize.c
- lib/xsize.h
m4/00gnulib.m4
m4/__inline.m4
m4/absolute-header.m4
m4/acl.m4
m4/alloca.m4
- m4/asm-underscore.m4
m4/assert_h.m4
m4/builtin-expect.m4
m4/byteswap.m4
@@ -1666,9 +1482,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/errno_h.m4
m4/euidaccess.m4
m4/execinfo.m4
- m4/exponentd.m4
- m4/exponentf.m4
- m4/exponentl.m4
m4/extensions.m4
m4/extern-inline.m4
m4/faccessat.m4
@@ -1679,13 +1492,9 @@ AC_DEFUN([gl_FILE_LIST], [
m4/fdopendir.m4
m4/filemode.m4
m4/flexmember.m4
- m4/float_h.m4
m4/fpending.m4
m4/fpieee.m4
m4/free.m4
- m4/frexp.m4
- m4/frexpl.m4
- m4/fseterr.m4
m4/fstatat.m4
m4/fsusage.m4
m4/fsync.m4
@@ -1704,15 +1513,9 @@ AC_DEFUN([gl_FILE_LIST], [
m4/group-member.m4
m4/ieee754-h.m4
m4/include_next.m4
- m4/intmax_t.m4
m4/inttypes.m4
- m4/inttypes_h.m4
- m4/isnand.m4
- m4/isnanf.m4
- m4/isnanl.m4
m4/largefile.m4
m4/lchmod.m4
- m4/ldexpl.m4
m4/libgmp.m4
m4/limits-h.m4
m4/locale-fr.m4
@@ -1720,7 +1523,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/malloc.m4
m4/manywarnings-c++.m4
m4/manywarnings.m4
- m4/math_h.m4
m4/mbstate_t.m4
m4/md5.m4
m4/memmem.m4
@@ -1744,10 +1546,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/pathmax.m4
m4/pid_t.m4
m4/pipe2.m4
- m4/printf-frexp.m4
- m4/printf-frexpl.m4
- m4/printf-posix.m4
- m4/printf.m4
m4/pselect.m4
m4/pthread_sigmask.m4
m4/rawmemchr.m4
@@ -1761,8 +1559,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/sig2str.m4
m4/sigdescr_np.m4
m4/signal_h.m4
- m4/signbit.m4
- m4/size_max.m4
m4/socklen.m4
m4/ssize_t.m4
m4/stat-time.m4
@@ -1770,7 +1566,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/stdalign.m4
m4/stddef_h.m4
m4/stdint.m4
- m4/stdint_h.m4
m4/stdio_h.m4
m4/stdlib_h.m4
m4/stpcpy.m4
@@ -1800,15 +1595,10 @@ AC_DEFUN([gl_FILE_LIST], [
m4/utimensat.m4
m4/utimes.m4
m4/vararrays.m4
- m4/vasnprintf.m4
- m4/vasprintf-posix.m4
- m4/vasprintf.m4
- m4/vfprintf-posix.m4
m4/warn-on-use.m4
m4/warnings.m4
m4/wchar_t.m4
m4/wint_t.m4
m4/xattr.m4
- m4/xsize.m4
m4/zzgnulib.m4
])
diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4
deleted file mode 100644
index ef32e1b9ca9..00000000000
--- a/m4/intmax_t.m4
+++ /dev/null
@@ -1,59 +0,0 @@
-# intmax_t.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2023 Free Software Foundation,
-dnl 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 From Paul Eggert.
-
-AC_PREREQ([2.53])
-
-# Define intmax_t to 'long' or 'long long'
-# if it is not already defined in <stdint.h> or <inttypes.h>.
-
-AC_DEFUN([gl_AC_TYPE_INTMAX_T],
-[
- dnl For simplicity, we assume that a header file defines 'intmax_t' if and
- dnl only if it defines 'uintmax_t'.
- AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
- AC_REQUIRE([gl_AC_HEADER_STDINT_H])
- if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
- AC_DEFINE_UNQUOTED([intmax_t], [long long],
- [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
- else
- AC_DEFINE([HAVE_INTMAX_T], [1],
- [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
- fi
-])
-
-dnl An alternative would be to explicitly test for 'intmax_t'.
-
-AC_DEFUN([gt_AC_TYPE_INTMAX_T],
-[
- AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
- AC_REQUIRE([gl_AC_HEADER_STDINT_H])
- AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#include <stddef.h>
-#include <stdlib.h>
-#if HAVE_STDINT_H_WITH_UINTMAX
-#include <stdint.h>
-#endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
-#include <inttypes.h>
-#endif
- ]],
- [[intmax_t x = -1; return !x;]])],
- [gt_cv_c_intmax_t=yes],
- [gt_cv_c_intmax_t=no])])
- if test $gt_cv_c_intmax_t = yes; then
- AC_DEFINE([HAVE_INTMAX_T], [1],
- [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
- else
- AC_DEFINE_UNQUOTED([intmax_t], [long long],
- [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
- fi
-])
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
deleted file mode 100644
index 68c60e9dbb6..00000000000
--- a/m4/inttypes_h.m4
+++ /dev/null
@@ -1,29 +0,0 @@
-# inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2023 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 From Paul Eggert.
-
-# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
-# doesn't clash with <sys/types.h>, and declares uintmax_t.
-
-AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
-[
- AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#include <sys/types.h>
-#include <inttypes.h>
- ]],
- [[uintmax_t i = (uintmax_t) -1; return !i;]])],
- [gl_cv_header_inttypes_h=yes],
- [gl_cv_header_inttypes_h=no])])
- if test $gl_cv_header_inttypes_h = yes; then
- AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
- [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
- and declares uintmax_t. ])
- fi
-])
diff --git a/m4/isnand.m4 b/m4/isnand.m4
deleted file mode 100644
index 95346f420b7..00000000000
--- a/m4/isnand.m4
+++ /dev/null
@@ -1,96 +0,0 @@
-# isnand.m4 serial 12
-dnl Copyright (C) 2007-2023 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 Check how to get or define isnand().
-
-AC_DEFUN([gl_FUNC_ISNAND],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- ISNAND_LIBM=
- gl_HAVE_ISNAND_NO_LIBM
- if test $gl_cv_func_isnand_no_libm = no; then
- gl_HAVE_ISNAND_IN_LIBM
- if test $gl_cv_func_isnand_in_libm = yes; then
- ISNAND_LIBM=-lm
- fi
- fi
- dnl The variable gl_func_isnand set here is used by isnan.m4.
- if test $gl_cv_func_isnand_no_libm = yes \
- || test $gl_cv_func_isnand_in_libm = yes; then
- gl_func_isnand=yes
- else
- gl_func_isnand=no
- HAVE_ISNAND=0
- fi
- AC_SUBST([ISNAND_LIBM])
-])
-
-dnl Check how to get or define isnand() without linking with libm.
-
-AC_DEFUN([gl_FUNC_ISNAND_NO_LIBM],
-[
- gl_HAVE_ISNAND_NO_LIBM
- gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
- if test $gl_cv_func_isnand_no_libm = yes; then
- AC_DEFINE([HAVE_ISNAND_IN_LIBC], [1],
- [Define if the isnan(double) function is available in libc.])
- fi
-])
-
-dnl Prerequisites of replacement isnand definition. It does not need -lm.
-AC_DEFUN([gl_PREREQ_ISNAND],
-[
- AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
-])
-
-dnl Test whether isnand() can be used with libm.
-
-AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(double) can be used with libm],
- [gl_cv_func_isnand_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
- # undef isnand
- # define isnand(x) __builtin_isnan ((double)(x))
- #elif defined isnan
- # undef isnand
- # define isnand(x) isnan ((double)(x))
- #endif
- double x;]],
- [[return isnand (x);]])],
- [gl_cv_func_isnand_in_libm=yes],
- [gl_cv_func_isnand_in_libm=no])
- LIBS="$save_LIBS"
- ])
-])
-
-AC_DEFUN([gl_HAVE_ISNAND_NO_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(double) can be used without linking with libm],
- [gl_cv_func_isnand_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
- # undef isnand
- # define isnand(x) __builtin_isnan ((double)(x))
- #else
- # undef isnand
- # define isnand(x) isnan ((double)(x))
- #endif
- double x;]],
- [[return isnand (x);]])],
- [gl_cv_func_isnand_no_libm=yes],
- [gl_cv_func_isnand_no_libm=no])
- ])
-])
diff --git a/m4/isnanf.m4 b/m4/isnanf.m4
deleted file mode 100644
index 01f7bbd20d8..00000000000
--- a/m4/isnanf.m4
+++ /dev/null
@@ -1,197 +0,0 @@
-# isnanf.m4 serial 18
-dnl Copyright (C) 2007-2023 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 Check how to get or define isnanf().
-
-AC_DEFUN([gl_FUNC_ISNANF],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- ISNANF_LIBM=
- gl_HAVE_ISNANF_NO_LIBM
- if test $gl_cv_func_isnanf_no_libm = no; then
- gl_HAVE_ISNANF_IN_LIBM
- if test $gl_cv_func_isnanf_in_libm = yes; then
- ISNANF_LIBM=-lm
- fi
- fi
- dnl The variable gl_func_isnanf set here is used by isnan.m4.
- if test $gl_cv_func_isnanf_no_libm = yes \
- || test $gl_cv_func_isnanf_in_libm = yes; then
- save_LIBS="$LIBS"
- LIBS="$LIBS $ISNANF_LIBM"
- gl_ISNANF_WORKS
- LIBS="$save_LIBS"
- case "$gl_cv_func_isnanf_works" in
- *yes) gl_func_isnanf=yes ;;
- *) gl_func_isnanf=no; ISNANF_LIBM= ;;
- esac
- else
- gl_func_isnanf=no
- fi
- if test $gl_func_isnanf != yes; then
- HAVE_ISNANF=0
- fi
- AC_SUBST([ISNANF_LIBM])
-])
-
-dnl Check how to get or define isnanf() without linking with libm.
-
-AC_DEFUN([gl_FUNC_ISNANF_NO_LIBM],
-[
- gl_HAVE_ISNANF_NO_LIBM
- if test $gl_cv_func_isnanf_no_libm = yes; then
- gl_ISNANF_WORKS
- fi
- if test $gl_cv_func_isnanf_no_libm = yes \
- && { case "$gl_cv_func_isnanf_works" in
- *yes) true;;
- *) false;;
- esac
- }; then
- gl_func_isnanf_no_libm=yes
- AC_DEFINE([HAVE_ISNANF_IN_LIBC], [1],
- [Define if the isnan(float) function is available in libc.])
- else
- gl_func_isnanf_no_libm=no
- fi
-])
-
-dnl Prerequisites of replacement isnanf definition. It does not need -lm.
-AC_DEFUN([gl_PREREQ_ISNANF],
-[
- gl_FLOAT_EXPONENT_LOCATION
-])
-
-dnl Test whether isnanf() can be used without libm.
-AC_DEFUN([gl_HAVE_ISNANF_NO_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(float) can be used without linking with libm],
- [gl_cv_func_isnanf_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
- # undef isnanf
- # define isnanf(x) __builtin_isnan ((float)(x))
- #elif defined isnan
- # undef isnanf
- # define isnanf(x) isnan ((float)(x))
- #endif
- float x;]],
- [[return isnanf (x);]])],
- [gl_cv_func_isnanf_no_libm=yes],
- [gl_cv_func_isnanf_no_libm=no])
- ])
-])
-
-dnl Test whether isnanf() can be used with libm.
-AC_DEFUN([gl_HAVE_ISNANF_IN_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(float) can be used with libm],
- [gl_cv_func_isnanf_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
- # undef isnanf
- # define isnanf(x) __builtin_isnan ((float)(x))
- #elif defined isnan
- # undef isnanf
- # define isnanf(x) isnan ((float)(x))
- #endif
- float x;]],
- [[return isnanf (x);]])],
- [gl_cv_func_isnanf_in_libm=yes],
- [gl_cv_func_isnanf_in_libm=no])
- LIBS="$save_LIBS"
- ])
-])
-
-dnl Test whether isnanf() rejects Infinity (this fails on Solaris 2.5.1),
-dnl recognizes a NaN (this fails on IRIX 6.5 with cc), and recognizes a NaN
-dnl with in-memory representation 0x7fbfffff (this fails on IRIX 6.5).
-AC_DEFUN([gl_ISNANF_WORKS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION])
- AC_CACHE_CHECK([whether isnan(float) works], [gl_cv_func_isnanf_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <math.h>
-#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
-# undef isnanf
-# define isnanf(x) __builtin_isnan ((float)(x))
-#elif defined isnan
-# undef isnanf
-# define isnanf(x) isnan ((float)(x))
-#endif
-/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */
-#ifdef __DECC
-static float
-NaN ()
-{
- static float zero = 0.0f;
- return zero / zero;
-}
-#else
-# define NaN() (0.0f / 0.0f)
-#endif
-#define NWORDS \
- ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { unsigned int word[NWORDS]; float value; } memory_float;
-int main()
-{
- int result = 0;
-
- if (isnanf (1.0f / 0.0f))
- result |= 1;
-
- if (!isnanf (NaN ()))
- result |= 2;
-
-#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
- /* The isnanf function should be immune against changes in the sign bit and
- in the mantissa bits. The xor operation twiddles a bit that can only be
- a sign bit or a mantissa bit. */
- if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0)
- {
- memory_float m;
-
- m.value = NaN ();
- /* Set the bits below the exponent to 01111...111. */
- m.word[0] &= -1U << FLT_EXPBIT0_BIT;
- m.word[0] |= (1U << (FLT_EXPBIT0_BIT - 1)) - 1;
- if (!isnanf (m.value))
- result |= 4;
- }
-#endif
-
- return result;
-}]])],
- [gl_cv_func_isnanf_works=yes],
- [gl_cv_func_isnanf_works=no],
- [case "$host_os" in
- irix* | solaris*) gl_cv_func_isnanf_works="guessing no" ;;
- mingw*) # Guess yes on mingw, no on MSVC.
- AC_EGREP_CPP([Known], [
-#ifdef __MINGW32__
- Known
-#endif
- ],
- [gl_cv_func_isnanf_works="guessing yes"],
- [gl_cv_func_isnanf_works="guessing no"])
- ;;
- *) gl_cv_func_isnanf_works="guessing yes" ;;
- esac
- ])
- ])
-])
diff --git a/m4/isnanl.m4 b/m4/isnanl.m4
deleted file mode 100644
index bb39d02558f..00000000000
--- a/m4/isnanl.m4
+++ /dev/null
@@ -1,248 +0,0 @@
-# isnanl.m4 serial 22
-dnl Copyright (C) 2007-2023 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.
-
-AC_DEFUN([gl_FUNC_ISNANL],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- ISNANL_LIBM=
- gl_HAVE_ISNANL_NO_LIBM
- if test $gl_cv_func_isnanl_no_libm = no; then
- gl_HAVE_ISNANL_IN_LIBM
- if test $gl_cv_func_isnanl_in_libm = yes; then
- ISNANL_LIBM=-lm
- fi
- fi
- dnl The variable gl_func_isnanl set here is used by isnan.m4.
- if test $gl_cv_func_isnanl_no_libm = yes \
- || test $gl_cv_func_isnanl_in_libm = yes; then
- save_LIBS="$LIBS"
- LIBS="$LIBS $ISNANL_LIBM"
- gl_FUNC_ISNANL_WORKS
- LIBS="$save_LIBS"
- case "$gl_cv_func_isnanl_works" in
- *yes) gl_func_isnanl=yes ;;
- *) gl_func_isnanl=no; ISNANL_LIBM= ;;
- esac
- else
- gl_func_isnanl=no
- fi
- if test $gl_func_isnanl != yes; then
- HAVE_ISNANL=0
- fi
- AC_SUBST([ISNANL_LIBM])
-])
-
-AC_DEFUN([gl_FUNC_ISNANL_NO_LIBM],
-[
- gl_HAVE_ISNANL_NO_LIBM
- gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
- if test $gl_func_isnanl_no_libm = yes; then
- gl_FUNC_ISNANL_WORKS
- case "$gl_cv_func_isnanl_works" in
- *yes) ;;
- *) gl_func_isnanl_no_libm=no ;;
- esac
- fi
- if test $gl_func_isnanl_no_libm = yes; then
- AC_DEFINE([HAVE_ISNANL_IN_LIBC], [1],
- [Define if the isnan(long double) function is available in libc.])
- fi
-])
-
-dnl Prerequisites of replacement isnanl definition. It does not need -lm.
-AC_DEFUN([gl_PREREQ_ISNANL],
-[
- gl_LONG_DOUBLE_EXPONENT_LOCATION
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
-])
-
-dnl Test whether isnanl() can be used without libm.
-AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(long double) can be used without linking with libm],
- [gl_cv_func_isnanl_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
- # undef isnanl
- # define isnanl(x) __builtin_isnan ((long double)(x))
- #elif defined isnan
- # undef isnanl
- # define isnanl(x) isnan ((long double)(x))
- #endif
- long double x;]],
- [[return isnanl (x);]])],
- [gl_cv_func_isnanl_no_libm=yes],
- [gl_cv_func_isnanl_no_libm=no])
- ])
-])
-
-dnl Test whether isnanl() can be used with libm.
-AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(long double) can be used with libm],
- [gl_cv_func_isnanl_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
- # undef isnanl
- # define isnanl(x) __builtin_isnan ((long double)(x))
- #elif defined isnan
- # undef isnanl
- # define isnanl(x) isnan ((long double)(x))
- #endif
- long double x;]],
- [[return isnanl (x);]])],
- [gl_cv_func_isnanl_in_libm=yes],
- [gl_cv_func_isnanl_in_libm=no])
- LIBS="$save_LIBS"
- ])
-])
-
-dnl Test whether isnanl() recognizes all canonical numbers which are neither
-dnl finite nor infinite.
-AC_DEFUN([gl_FUNC_ISNANL_WORKS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether isnanl works], [gl_cv_func_isnanl_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <float.h>
-#include <limits.h>
-#include <math.h>
-#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
-# undef isnanl
-# define isnanl(x) __builtin_isnan ((long double)(x))
-#elif defined isnan
-# undef isnanl
-# define isnanl(x) isnan ((long double)(x))
-#endif
-#define NWORDS \
- ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { unsigned int word[NWORDS]; long double value; }
- memory_long_double;
-/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
- runtime type conversion. */
-#ifdef __sgi
-static long double NaNl ()
-{
- double zero = 0.0;
- return zero / zero;
-}
-#else
-# define NaNl() (0.0L / 0.0L)
-#endif
-int main ()
-{
- int result = 0;
-
- if (!isnanl (NaNl ()))
- result |= 1;
-
- {
- memory_long_double m;
- unsigned int i;
-
- /* The isnanl function should be immune against changes in the sign bit and
- in the mantissa bits. The xor operation twiddles a bit that can only be
- a sign bit or a mantissa bit (since the exponent never extends to
- bit 31). */
- m.value = NaNl ();
- m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
- for (i = 0; i < NWORDS; i++)
- m.word[i] |= 1;
- if (!isnanl (m.value))
- result |= 1;
- }
-
-#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
-/* Representation of an 80-bit 'long double' as an initializer for a sequence
- of 'unsigned int' words. */
-# ifdef WORDS_BIGENDIAN
-# define LDBL80_WORDS(exponent,manthi,mantlo) \
- { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
- ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
- (unsigned int) (mantlo) << 16 \
- }
-# else
-# define LDBL80_WORDS(exponent,manthi,mantlo) \
- { mantlo, manthi, exponent }
-# endif
- { /* Quiet NaN. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
- if (!isnanl (x.value))
- result |= 2;
- }
- {
- /* Signalling NaN. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
- if (!isnanl (x.value))
- result |= 2;
- }
- /* isnanl should return something even for noncanonical values. */
- { /* Pseudo-NaN. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
- if (isnanl (x.value) && !isnanl (x.value))
- result |= 4;
- }
- { /* Pseudo-Infinity. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
- if (isnanl (x.value) && !isnanl (x.value))
- result |= 8;
- }
- { /* Pseudo-Zero. */
- static memory_long_double x =
- { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
- if (isnanl (x.value) && !isnanl (x.value))
- result |= 16;
- }
- { /* Unnormalized number. */
- static memory_long_double x =
- { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
- if (isnanl (x.value) && !isnanl (x.value))
- result |= 32;
- }
- { /* Pseudo-Denormal. */
- static memory_long_double x =
- { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
- if (isnanl (x.value) && !isnanl (x.value))
- result |= 64;
- }
-#endif
-
- return result;
-}]])],
- [gl_cv_func_isnanl_works=yes],
- [gl_cv_func_isnanl_works=no],
- [case "$host_os" in
- mingw*) # Guess yes on mingw, no on MSVC.
- AC_EGREP_CPP([Known], [
-#ifdef __MINGW32__
- Known
-#endif
- ],
- [gl_cv_func_isnanl_works="guessing yes"],
- [gl_cv_func_isnanl_works="guessing no"])
- ;;
- *) gl_cv_func_isnanl_works="guessing yes" ;;
- esac
- ])
- ])
-])
diff --git a/m4/ldexpl.m4 b/m4/ldexpl.m4
deleted file mode 100644
index f2785d67c5b..00000000000
--- a/m4/ldexpl.m4
+++ /dev/null
@@ -1,135 +0,0 @@
-# ldexpl.m4 serial 17
-dnl Copyright (C) 2007-2023 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.
-
-AC_DEFUN([gl_FUNC_LDEXPL],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
- AC_REQUIRE([gl_FUNC_ISNANL]) dnl for ISNANL_LIBM
-
- dnl Persuade glibc <math.h> to declare ldexpl().
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
- dnl Check whether it's declared.
- dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
-
- LDEXPL_LIBM=
- if test $HAVE_DECL_LDEXPL = 1; then
- gl_CHECK_LDEXPL_NO_LIBM
- if test $gl_cv_func_ldexpl_no_libm = no; then
- AC_CACHE_CHECK([whether ldexpl() can be used with libm],
- [gl_cv_func_ldexpl_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x;]],
- [[return ldexpl (x, -1) > 0;]])],
- [gl_cv_func_ldexpl_in_libm=yes],
- [gl_cv_func_ldexpl_in_libm=no])
- LIBS="$save_LIBS"
- ])
- if test $gl_cv_func_ldexpl_in_libm = yes; then
- LDEXPL_LIBM=-lm
- fi
- fi
- if test $gl_cv_func_ldexpl_no_libm = yes \
- || test $gl_cv_func_ldexpl_in_libm = yes; then
- save_LIBS="$LIBS"
- LIBS="$LIBS $LDEXPL_LIBM"
- gl_FUNC_LDEXPL_WORKS
- LIBS="$save_LIBS"
- case "$gl_cv_func_ldexpl_works" in
- *yes) gl_func_ldexpl=yes ;;
- *) gl_func_ldexpl=no; REPLACE_LDEXPL=1 ;;
- esac
- else
- gl_func_ldexpl=no
- fi
- if test $gl_func_ldexpl = yes; then
- AC_DEFINE([HAVE_LDEXPL], [1],
- [Define if the ldexpl() function is available.])
- fi
- fi
- if test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; then
- dnl Find libraries needed to link lib/ldexpl.c.
- if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
- AC_REQUIRE([gl_FUNC_LDEXP])
- LDEXPL_LIBM="$LDEXP_LIBM"
- else
- LDEXPL_LIBM="$ISNANL_LIBM"
- fi
- fi
- AC_SUBST([LDEXPL_LIBM])
-])
-
-dnl Test whether ldexpl() can be used without linking with libm.
-dnl Set gl_cv_func_ldexpl_no_libm to 'yes' or 'no' accordingly.
-AC_DEFUN([gl_CHECK_LDEXPL_NO_LIBM],
-[
- AC_CACHE_CHECK([whether ldexpl() can be used without linking with libm],
- [gl_cv_func_ldexpl_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x;]],
- [[return ldexpl (x, -1) > 0;]])],
- [gl_cv_func_ldexpl_no_libm=yes],
- [gl_cv_func_ldexpl_no_libm=no])
- ])
-])
-
-dnl Test whether ldexpl() works on finite numbers (this fails on AIX 5.1
-dnl and Mac OS X 10.4/PowerPC).
-AC_DEFUN([gl_FUNC_LDEXPL_WORKS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether ldexpl works], [gl_cv_func_ldexpl_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <math.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-long double ldexpl (long double, int);
-int main()
-{
- int result = 0;
- {
- volatile long double x = 1.0;
- volatile long double y = ldexpl (x, -1);
- if (y != 0.5L)
- result |= 1;
- }
- {
- volatile long double x = 1.73205L;
- volatile long double y = ldexpl (x, 0);
- if (y != x)
- result |= 2;
- }
- return result;
-}]])],
- [gl_cv_func_ldexpl_works=yes],
- [gl_cv_func_ldexpl_works=no],
- [
-changequote(,)dnl
- case "$host_os" in
- aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no" ;;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_ldexpl_works="guessing yes" ;;
- *) gl_cv_func_ldexpl_works="guessing yes" ;;
- esac
-changequote([,])dnl
- ])
- ])
-])
diff --git a/m4/math_h.m4 b/m4/math_h.m4
deleted file mode 100644
index d2e90ff1eb6..00000000000
--- a/m4/math_h.m4
+++ /dev/null
@@ -1,391 +0,0 @@
-# math_h.m4 serial 125
-dnl Copyright (C) 2007-2023 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.
-
-AC_DEFUN_ONCE([gl_MATH_H],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- gl_CHECK_NEXT_HEADERS([math.h])
-
- AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
- [[/* Solaris 10 has a broken definition of NAN. Other platforms
- fail to provide NAN, or provide it only in C99 mode; this
- test only needs to fail when NAN is provided but wrong. */
- float f = 1.0f;
-#ifdef NAN
- f = NAN;
-#endif
- return f == 0;]])],
- [gl_cv_header_math_nan_works=yes],
- [gl_cv_header_math_nan_works=no])])
- if test $gl_cv_header_math_nan_works = no; then
- REPLACE_NAN=1
- fi
- AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
- [[/* Solaris 10 has a broken definition of HUGE_VAL. */
- double d = HUGE_VAL;
- return d == 0;]])],
- [gl_cv_header_math_huge_val_works=yes],
- [gl_cv_header_math_huge_val_works=no])])
- if test $gl_cv_header_math_huge_val_works = no; then
- REPLACE_HUGE_VAL=1
- fi
-
- dnl Check for declarations of anything we want to poison if the
- dnl corresponding gnulib module is not in use.
- gl_WARN_ON_USE_PREPARE([[#include <math.h>]],
- [acosf acosl asinf asinl atanf atanl
- cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf
- expf expl exp2 exp2f exp2l expm1 expm1f expm1l
- fabsf fabsl floorf floorl fma fmaf fmal
- fmod fmodf fmodl frexpf frexpl hypotf hypotl
- ilogb ilogbf ilogbl
- ldexpf ldexpl
- log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
- logb logbf logbl
- modf modff modfl powf
- remainder remainderf remainderl
- rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl
- tanf tanl tanhf trunc truncf truncl])
-])
-
-# gl_MATH_MODULE_INDICATOR([modulename])
-# sets the shell variable that indicates the presence of the given module
-# to a C preprocessor expression that will evaluate to 1.
-# This macro invocation must not occur in macros that are AC_REQUIREd.
-AC_DEFUN([gl_MATH_MODULE_INDICATOR],
-[
- dnl Ensure to expand the default settings once only.
- gl_MATH_H_REQUIRE_DEFAULTS
- gl_MODULE_INDICATOR_SET_VARIABLE([$1])
- dnl Define it also as a C macro, for the benefit of the unit tests.
- gl_MODULE_INDICATOR_FOR_TESTS([$1])
-])
-
-# Initializes the default values for AC_SUBSTed shell variables.
-# This macro must not be AC_REQUIREd. It must only be invoked, and only
-# outside of macros or in macros that are not AC_REQUIREd.
-AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
-[
- m4_defun(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS], [
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATAN2F])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRT])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEIL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGN])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSHF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2F])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2L])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1F])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1L])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOOR])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMA])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMOD])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGB])
- 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_ISINF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10F])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10L])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1P])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2F])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2L])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGB])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POWF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDER])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINT])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINHF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL])
- dnl Support Microsoft deprecated alias function names by default.
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J0], [1])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J1], [1])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_JN], [1])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y0], [1])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y1], [1])
- gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_YN], [1])
- ])
- m4_require(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS])
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
-])
-
-AC_DEFUN([gl_MATH_H_DEFAULTS],
-[
- dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF])
- HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
- HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
- HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
- HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
- HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
- HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
- HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
- HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
- HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
- HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
- HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
- HAVE_COSF=1; AC_SUBST([HAVE_COSF])
- HAVE_COSL=1; AC_SUBST([HAVE_COSL])
- HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
- HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
- HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
- HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
- HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
- HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
- HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
- HAVE_FMA=1; AC_SUBST([HAVE_FMA])
- HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
- HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
- HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
- HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
- HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
- HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
- HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
- HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
- HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
- HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
- HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
- HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
- HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
- HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
- HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
- HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
- HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
- HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
- HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
- HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
- HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
- HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
- HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
- HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
- HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
- HAVE_POWF=1; AC_SUBST([HAVE_POWF])
- HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
- HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
- HAVE_RINT=1; AC_SUBST([HAVE_RINT])
- HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
- HAVE_SINF=1; AC_SUBST([HAVE_SINF])
- HAVE_SINL=1; AC_SUBST([HAVE_SINL])
- HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
- HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
- HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
- HAVE_TANF=1; AC_SUBST([HAVE_TANF])
- HAVE_TANL=1; AC_SUBST([HAVE_TANL])
- HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
- HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
- HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
- HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
- HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
- HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
- HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
- HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
- HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
- HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
- HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
- HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
- HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
- HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
- HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
- HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
- HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
- HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
- HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
- HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
- HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
- HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
- HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
- HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
- HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
- HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
- HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
- HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
- HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
- HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
- HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
- HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL])
- HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL])
- HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
- HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
- HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
- HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
- REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF])
- REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF])
- REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF])
- REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F])
- REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
- REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
- REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
- REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
- REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
- REPLACE_COSF=0; AC_SUBST([REPLACE_COSF])
- REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF])
- REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF])
- REPLACE_EXPL=0; AC_SUBST([REPLACE_EXPL])
- REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
- REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
- REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L])
- REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
- REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
- REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
- REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
- REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
- REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
- REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
- REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
- REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
- REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
- REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
- REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
- REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
- REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
- REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
- REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
- REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
- REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
- REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
- REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
- REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
- REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL])
- REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
- REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
- REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
- REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
- REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
- REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
- REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
- REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
- REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
- REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
- REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
- REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
- REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
- REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
- REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
- REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
- REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
- REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
- REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
- REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
- REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
- REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
- REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
- REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
- REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
- REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
- REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL])
- REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
- REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
- REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
- REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
- REPLACE_SIGNBIT_USING_BUILTINS=0; AC_SUBST([REPLACE_SIGNBIT_USING_BUILTINS])
- REPLACE_SINF=0; AC_SUBST([REPLACE_SINF])
- REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF])
- REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF])
- REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
- REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
- REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
- REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
- REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
- REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
-])
-
-# gl_LONG_DOUBLE_VS_DOUBLE
-# determines whether 'long double' and 'double' have the same representation.
-# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
-# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
-# The currently known platforms where this is the case are:
-# Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
-AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
-[
- AC_CACHE_CHECK([whether long double and double are the same],
- [gl_cv_long_double_equals_double],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[#include <float.h>]],
- [[typedef int check[sizeof (long double) == sizeof (double)
- && LDBL_MANT_DIG == DBL_MANT_DIG
- && LDBL_MAX_EXP == DBL_MAX_EXP
- && LDBL_MIN_EXP == DBL_MIN_EXP
- ? 1 : -1];
- ]])],
- [gl_cv_long_double_equals_double=yes],
- [gl_cv_long_double_equals_double=no])
- ])
- if test $gl_cv_long_double_equals_double = yes; then
- AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1],
- [Define to 1 if 'long double' and 'double' have the same representation.])
- HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
- else
- HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
- fi
- AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE])
-])
diff --git a/m4/printf-frexp.m4 b/m4/printf-frexp.m4
deleted file mode 100644
index 8f5844a2c1c..00000000000
--- a/m4/printf-frexp.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-# printf-frexp.m4 serial 5
-dnl Copyright (C) 2007, 2009-2023 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 Check how to define printf_frexp() without linking with libm.
-
-AC_DEFUN([gl_FUNC_PRINTF_FREXP],
-[
- AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM])
- if test $gl_cv_func_frexp_no_libm = yes; then
- gl_FUNC_FREXP_WORKS
- case "$gl_cv_func_frexp_works" in
- *yes)
- AC_DEFINE([HAVE_FREXP_IN_LIBC], [1],
- [Define if the frexp function is available in libc.])
- ;;
- esac
- fi
-
- AC_CACHE_CHECK([whether ldexp can be used without linking with libm],
- [gl_cv_func_ldexp_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- double x;
- int y;]],
- [[return ldexp (x, y) < 1;]])],
- [gl_cv_func_ldexp_no_libm=yes],
- [gl_cv_func_ldexp_no_libm=no])
- ])
- if test $gl_cv_func_ldexp_no_libm = yes; then
- AC_DEFINE([HAVE_LDEXP_IN_LIBC], [1],
- [Define if the ldexp function is available in libc.])
- fi
-])
diff --git a/m4/printf-frexpl.m4 b/m4/printf-frexpl.m4
deleted file mode 100644
index aee170ffd39..00000000000
--- a/m4/printf-frexpl.m4
+++ /dev/null
@@ -1,48 +0,0 @@
-# printf-frexpl.m4 serial 10
-dnl Copyright (C) 2007, 2009-2023 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 Check how to define printf_frexpl() without linking with libm.
-
-AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
-
- dnl Subset of gl_FUNC_FREXPL_NO_LIBM.
- gl_CHECK_FREXPL_NO_LIBM
- if test $gl_cv_func_frexpl_no_libm = yes; then
- gl_FUNC_FREXPL_WORKS
- case "$gl_cv_func_frexpl_works" in
- *yes) gl_func_frexpl_no_libm=yes ;;
- *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
- esac
- else
- gl_func_frexpl_no_libm=no
- dnl Set REPLACE_FREXPL here because the system may have frexpl in libm.
- REPLACE_FREXPL=1
- fi
- if test $gl_func_frexpl_no_libm = yes; then
- AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1],
- [Define if the frexpl function is available in libc.])
- dnl Also check whether it's declared.
- dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
- fi
-
- gl_CHECK_LDEXPL_NO_LIBM
- if test $gl_cv_func_ldexpl_no_libm = yes; then
- gl_FUNC_LDEXPL_WORKS
- case "$gl_cv_func_ldexpl_works" in
- *yes)
- AC_DEFINE([HAVE_LDEXPL_IN_LIBC], [1],
- [Define if the ldexpl function is available in libc.])
- dnl Also check whether it's declared.
- dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
- ;;
- esac
- fi
-])
diff --git a/m4/printf-posix.m4 b/m4/printf-posix.m4
deleted file mode 100644
index 9aebf4002d6..00000000000
--- a/m4/printf-posix.m4
+++ /dev/null
@@ -1,36 +0,0 @@
-# printf-posix.m4 serial 5
-dnl Copyright (C) 2007-2023 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.
-
-AC_DEFUN([gl_FUNC_PRINTF_POSIX],
-[
- AC_REQUIRE([gl_FUNC_PRINTF_IS_POSIX])
- if test $gl_cv_func_printf_posix = no; then
- gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
- gl_REPLACE_VASNPRINTF
- gl_REPLACE_PRINTF
- fi
-])
-
-dnl Test whether printf is POSIX compliant.
-dnl Result is gl_cv_func_printf_posix.
-AC_DEFUN([gl_FUNC_PRINTF_IS_POSIX],
-[
- AC_REQUIRE([gl_FUNC_VFPRINTF_IS_POSIX])
- gl_cv_func_printf_posix="$gl_cv_func_vfprintf_posix"
-])
-
-AC_DEFUN([gl_REPLACE_PRINTF],
-[
- AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
- AC_LIBOBJ([printf])
- REPLACE_PRINTF=1
- AC_DEFINE([REPLACE_PRINTF_POSIX], [1],
- [Define if printf is overridden by a POSIX compliant gnulib implementation.])
- gl_PREREQ_PRINTF
-])
-
-AC_DEFUN([gl_PREREQ_PRINTF], [:])
diff --git a/m4/printf.m4 b/m4/printf.m4
deleted file mode 100644
index 8b8f01067fc..00000000000
--- a/m4/printf.m4
+++ /dev/null
@@ -1,2158 +0,0 @@
-# printf.m4 serial 84
-dnl Copyright (C) 2003, 2007-2023 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 Test whether the *printf family of functions supports the 'j', 'z', 't',
-dnl 'L' size specifiers. (ISO C99, POSIX:2001)
-dnl Result is gl_cv_func_printf_sizes_c99.
-
-AC_DEFUN([gl_PRINTF_SIZES_C99],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([gl_AC_HEADER_STDINT_H])
- AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
- [gl_cv_func_printf_sizes_c99],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#if HAVE_STDINT_H_WITH_UINTMAX
-# include <stdint.h>
-#endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
-# include <inttypes.h>
-#endif
-static char buf[100];
-int main ()
-{
- int result = 0;
-#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
- buf[0] = '\0';
- if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
- || strcmp (buf, "12345671 33") != 0)
- result |= 1;
-#else
- result |= 1;
-#endif
- buf[0] = '\0';
- if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
- || strcmp (buf, "12345672 33") != 0)
- result |= 2;
- buf[0] = '\0';
- if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
- || strcmp (buf, "12345673 33") != 0)
- result |= 4;
- buf[0] = '\0';
- if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
- || strcmp (buf, "1.5 33") != 0)
- result |= 8;
- return result;
-}]])],
- [gl_cv_func_printf_sizes_c99=yes],
- [gl_cv_func_printf_sizes_c99=no],
- [
- case "$host_os" in
-changequote(,)dnl
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # Guess yes on FreeBSD >= 5.
- freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";;
- freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
- midnightbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # Guess yes on Mac OS X >= 10.3.
- darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";;
- darwin*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # Guess yes on OpenBSD >= 3.9.
- openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
- gl_cv_func_printf_sizes_c99="guessing no";;
- openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # Guess yes on Solaris >= 2.10.
- solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
- solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_printf_sizes_c99="guessing no";;
- netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # Guess yes on Android.
- linux*-android*) gl_cv_func_printf_sizes_c99="guessing yes";;
-changequote([,])dnl
- # Guess yes on MSVC, no on mingw.
- mingw*) AC_EGREP_CPP([Known], [
-#ifdef _MSC_VER
- Known
-#endif
- ],
- [gl_cv_func_printf_sizes_c99="guessing yes"],
- [gl_cv_func_printf_sizes_c99="guessing no"])
- ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_printf_sizes_c99="$gl_cross_guess_normal";;
- esac
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports the 'w8', 'w16',
-dnl 'w32', 'w64', 'wf8', 'wf16', 'wf32', 'wf64' size specifiers. (ISO C23)
-dnl Result is gl_cv_func_printf_sizes_c23.
-
-AC_DEFUN([gl_PRINTF_SIZES_C23],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([gl_AC_HEADER_STDINT_H])
- AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports size specifiers as in C23],
- [gl_cv_func_printf_sizes_c23],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#if HAVE_STDINT_H_WITH_UINTMAX
-# include <stdint.h>
-#endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
-# include <inttypes.h>
-#endif
-static char buf[100];
-int main ()
-{
- int result = 0;
- buf[0] = '\0';
- if (sprintf (buf, "%w8u %d", (uint8_t) 123, 33, 44, 55) < 0
- || strcmp (buf, "123 33") != 0)
- result |= 1;
- buf[0] = '\0';
- if (sprintf (buf, "%wf8u %d", (uint_fast8_t) 123, 33, 44, 55) < 0
- || strcmp (buf, "123 33") != 0)
- result |= 1;
- buf[0] = '\0';
- if (sprintf (buf, "%w16u %d", (uint16_t) 12345, 33, 44, 55) < 0
- || strcmp (buf, "12345 33") != 0)
- result |= 2;
- buf[0] = '\0';
- if (sprintf (buf, "%wf16u %d", (uint_fast16_t) 12345, 33, 44, 55) < 0
- || strcmp (buf, "12345 33") != 0)
- result |= 2;
- buf[0] = '\0';
- if (sprintf (buf, "%w32u %d", (uint32_t) 12345671, 33, 44, 55) < 0
- || strcmp (buf, "12345671 33") != 0)
- result |= 4;
- buf[0] = '\0';
- if (sprintf (buf, "%wf32u %d", (uint_fast32_t) 12345671, 33, 44, 55) < 0
- || strcmp (buf, "12345671 33") != 0)
- result |= 4;
-#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
- buf[0] = '\0';
- if (sprintf (buf, "%w64u %d", (uint64_t) 12345671, 33, 44, 55) < 0
- || strcmp (buf, "12345671 33") != 0)
- result |= 8;
- buf[0] = '\0';
- if (sprintf (buf, "%wf64u %d", (uint_fast64_t) 12345671, 33, 44, 55) < 0
- || strcmp (buf, "12345671 33") != 0)
- result |= 8;
-#else
- result |= 8;
-#endif
- return result;
-}]])],
- [gl_cv_func_printf_sizes_c23=yes],
- [gl_cv_func_printf_sizes_c23=no],
- [
- case "$host_os" in
- # Guess no on glibc systems.
- *-gnu* | gnu*) gl_cv_func_printf_sizes_c23="guessing no";;
- # Guess no on musl systems.
- *-musl* | midipix*) gl_cv_func_printf_sizes_c23="guessing no";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_sizes_c23="guessing no";;
- # Guess no on native Windows.
- mingw*) gl_cv_func_printf_sizes_c23="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_printf_sizes_c23="$gl_cross_guess_normal";;
- esac
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports 'long double'
-dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001)
-dnl Result is gl_cv_func_printf_long_double.
-
-AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports 'long double' arguments],
- [gl_cv_func_printf_long_double],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-static char buf[10000];
-int main ()
-{
- int result = 0;
- buf[0] = '\0';
- if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
- || strcmp (buf, "1.750000 33") != 0)
- result |= 1;
- buf[0] = '\0';
- if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
- || strcmp (buf, "1.750000e+00 33") != 0)
- result |= 2;
- buf[0] = '\0';
- if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
- || strcmp (buf, "1.75 33") != 0)
- result |= 4;
- return result;
-}]])],
- [gl_cv_func_printf_long_double=yes],
- [gl_cv_func_printf_long_double=no],
- [case "$host_os" in
- # Guess no on BeOS.
- beos*) gl_cv_func_printf_long_double="guessing no";;
- # Guess yes on Android.
- linux*-android*) gl_cv_func_printf_long_double="guessing yes";;
- # Guess yes on MSVC, no on mingw.
- mingw*) AC_EGREP_CPP([Known], [
-#ifdef _MSC_VER
- Known
-#endif
- ],
- [gl_cv_func_printf_long_double="guessing yes"],
- [gl_cv_func_printf_long_double="guessing no"])
- ;;
- *) gl_cv_func_printf_long_double="guessing yes";;
- esac
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports infinite and NaN
-dnl 'double' arguments and negative zero arguments in the %f, %e, %g
-dnl directives. (ISO C99, POSIX:2001)
-dnl Result is gl_cv_func_printf_infinite.
-
-AC_DEFUN([gl_PRINTF_INFINITE],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
- [gl_cv_func_printf_infinite],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-static int
-strisnan (const char *string, size_t start_index, size_t end_index)
-{
- if (start_index < end_index)
- {
- if (string[start_index] == '-')
- start_index++;
- if (start_index + 3 <= end_index
- && memcmp (string + start_index, "nan", 3) == 0)
- {
- start_index += 3;
- if (start_index == end_index
- || (string[start_index] == '(' && string[end_index - 1] == ')'))
- return 1;
- }
- }
- return 0;
-}
-static int
-have_minus_zero ()
-{
- static double plus_zero = 0.0;
- double minus_zero = - plus_zero;
- return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0;
-}
-static char buf[10000];
-static double zero = 0.0;
-int main ()
-{
- int result = 0;
- if (sprintf (buf, "%f", 1.0 / zero) < 0
- || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
- result |= 1;
- if (sprintf (buf, "%f", -1.0 / zero) < 0
- || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
- result |= 1;
- if (sprintf (buf, "%f", zero / zero) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 2;
- if (sprintf (buf, "%e", 1.0 / zero) < 0
- || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
- result |= 4;
- if (sprintf (buf, "%e", -1.0 / zero) < 0
- || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
- result |= 4;
- if (sprintf (buf, "%e", zero / zero) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 8;
- if (sprintf (buf, "%g", 1.0 / zero) < 0
- || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
- result |= 16;
- if (sprintf (buf, "%g", -1.0 / zero) < 0
- || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
- result |= 16;
- if (sprintf (buf, "%g", zero / zero) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 32;
- /* This test fails on HP-UX 10.20. */
- if (have_minus_zero ())
- if (sprintf (buf, "%g", - zero) < 0
- || strcmp (buf, "-0") != 0)
- result |= 64;
- return result;
-}]])],
- [gl_cv_func_printf_infinite=yes],
- [gl_cv_func_printf_infinite=no],
- [
- case "$host_os" in
-changequote(,)dnl
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on FreeBSD >= 6.
- freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";;
- freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
- midnightbsd*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on Mac OS X >= 10.3.
- darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
- darwin*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on HP-UX >= 11.
- hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
- hpux*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_printf_infinite="guessing no";;
- netbsd*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on OpenBSD >= 6.0.
- openbsd[1-5].*) gl_cv_func_printf_infinite="guessing no";;
- openbsd*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_infinite="guessing no";;
-changequote([,])dnl
- # Guess yes on MSVC, no on mingw.
- mingw*) AC_EGREP_CPP([Known], [
-#ifdef _MSC_VER
- Known
-#endif
- ],
- [gl_cv_func_printf_infinite="guessing yes"],
- [gl_cv_func_printf_infinite="guessing no"])
- ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_printf_infinite="$gl_cross_guess_normal";;
- esac
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports infinite and NaN
-dnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001)
-dnl Result is gl_cv_func_printf_infinite_long_double.
-
-AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
-[
- AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- dnl The user can set or unset the variable gl_printf_safe to indicate
- dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
- if test -n "$gl_printf_safe"; then
- AC_DEFINE([CHECK_PRINTF_SAFE], [1],
- [Define if you wish *printf() functions that have a safe handling of
- non-IEEE-754 'long double' values.])
- fi
- case "$gl_cv_func_printf_long_double" in
- *yes)
- AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments],
- [gl_cv_func_printf_infinite_long_double],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-]GL_NOCRASH[
-#include <float.h>
-#include <stdio.h>
-#include <string.h>
-static int
-strisnan (const char *string, size_t start_index, size_t end_index)
-{
- if (start_index < end_index)
- {
- if (string[start_index] == '-')
- start_index++;
- if (start_index + 3 <= end_index
- && memcmp (string + start_index, "nan", 3) == 0)
- {
- start_index += 3;
- if (start_index == end_index
- || (string[start_index] == '(' && string[end_index - 1] == ')'))
- return 1;
- }
- }
- return 0;
-}
-static char buf[10000];
-static long double zeroL = 0.0L;
-int main ()
-{
- int result = 0;
- nocrash_init();
- if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0
- || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
- result |= 1;
- if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0
- || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
- result |= 1;
- if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 1;
- if (sprintf (buf, "%Le", 1.0L / zeroL) < 0
- || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
- result |= 1;
- if (sprintf (buf, "%Le", -1.0L / zeroL) < 0
- || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
- result |= 1;
- if (sprintf (buf, "%Le", zeroL / zeroL) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 1;
- if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0
- || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
- result |= 1;
- if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0
- || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
- result |= 1;
- if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 1;
-#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
-/* Representation of an 80-bit 'long double' as an initializer for a sequence
- of 'unsigned int' words. */
-# ifdef WORDS_BIGENDIAN
-# define LDBL80_WORDS(exponent,manthi,mantlo) \
- { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
- ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
- (unsigned int) (mantlo) << 16 \
- }
-# else
-# define LDBL80_WORDS(exponent,manthi,mantlo) \
- { mantlo, manthi, exponent }
-# endif
- { /* Quiet NaN. */
- static union { unsigned int word[4]; long double value; } x =
- { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
- if (sprintf (buf, "%Lf", x.value) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 2;
- if (sprintf (buf, "%Le", x.value) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 2;
- if (sprintf (buf, "%Lg", x.value) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 2;
- }
- {
- /* Signalling NaN. */
- static union { unsigned int word[4]; long double value; } x =
- { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
- if (sprintf (buf, "%Lf", x.value) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 2;
- if (sprintf (buf, "%Le", x.value) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 2;
- if (sprintf (buf, "%Lg", x.value) < 0
- || !strisnan (buf, 0, strlen (buf)))
- result |= 2;
- }
- { /* Pseudo-NaN. */
- static union { unsigned int word[4]; long double value; } x =
- { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
- if (sprintf (buf, "%Lf", x.value) <= 0)
- result |= 4;
- if (sprintf (buf, "%Le", x.value) <= 0)
- result |= 4;
- if (sprintf (buf, "%Lg", x.value) <= 0)
- result |= 4;
- }
- { /* Pseudo-Infinity. */
- static union { unsigned int word[4]; long double value; } x =
- { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
- if (sprintf (buf, "%Lf", x.value) <= 0)
- result |= 8;
- if (sprintf (buf, "%Le", x.value) <= 0)
- result |= 8;
- if (sprintf (buf, "%Lg", x.value) <= 0)
- result |= 8;
- }
- { /* Pseudo-Zero. */
- static union { unsigned int word[4]; long double value; } x =
- { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
- if (sprintf (buf, "%Lf", x.value) <= 0)
- result |= 16;
- if (sprintf (buf, "%Le", x.value) <= 0)
- result |= 16;
- if (sprintf (buf, "%Lg", x.value) <= 0)
- result |= 16;
- }
- { /* Unnormalized number. */
- static union { unsigned int word[4]; long double value; } x =
- { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
- if (sprintf (buf, "%Lf", x.value) <= 0)
- result |= 32;
- if (sprintf (buf, "%Le", x.value) <= 0)
- result |= 32;
- if (sprintf (buf, "%Lg", x.value) <= 0)
- result |= 32;
- }
- { /* Pseudo-Denormal. */
- static union { unsigned int word[4]; long double value; } x =
- { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
- if (sprintf (buf, "%Lf", x.value) <= 0)
- result |= 64;
- if (sprintf (buf, "%Le", x.value) <= 0)
- result |= 64;
- if (sprintf (buf, "%Lg", x.value) <= 0)
- result |= 64;
- }
-#endif
- return result;
-}]])],
- [gl_cv_func_printf_infinite_long_double=yes],
- [gl_cv_func_printf_infinite_long_double=no],
- [case "$host_cpu" in
- # Guess no on ia64, x86_64, i386.
- ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
- *)
- case "$host_os" in
-changequote(,)dnl
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- # Guess yes on FreeBSD >= 6.
- freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";;
- freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- midnightbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- # Guess yes on HP-UX >= 11.
- hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
- hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- # Guess yes on OpenBSD >= 6.0.
- openbsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";;
- openbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_infinite_long_double="guessing no";;
-changequote([,])dnl
- # Guess yes on MSVC, no on mingw.
- mingw*) AC_EGREP_CPP([Known], [
-#ifdef _MSC_VER
- Known
-#endif
- ],
- [gl_cv_func_printf_infinite_long_double="guessing yes"],
- [gl_cv_func_printf_infinite_long_double="guessing no"])
- ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_printf_infinite_long_double="$gl_cross_guess_normal";;
- esac
- ;;
- esac
- ])
- ])
- ;;
- *)
- gl_cv_func_printf_infinite_long_double="irrelevant"
- ;;
- esac
-])
-
-dnl Test whether the *printf family of functions supports the 'a' and 'A'
-dnl conversion specifier for hexadecimal output of floating-point numbers.
-dnl (ISO C99, POSIX:2001)
-dnl Result is gl_cv_func_printf_directive_a.
-
-AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
- [gl_cv_func_printf_directive_a],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-static double zero = 0.0;
-int main ()
-{
- int result = 0;
- if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
- || (strcmp (buf, "0x1.922p+1 33") != 0
- && strcmp (buf, "0x3.244p+0 33") != 0
- && strcmp (buf, "0x6.488p-1 33") != 0
- && strcmp (buf, "0xc.91p-2 33") != 0))
- result |= 1;
- if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
- || (strcmp (buf, "-0X1.922P+1 33") != 0
- && strcmp (buf, "-0X3.244P+0 33") != 0
- && strcmp (buf, "-0X6.488P-1 33") != 0
- && strcmp (buf, "-0XC.91P-2 33") != 0))
- result |= 2;
- /* This catches a FreeBSD 13.0 bug: it doesn't round. */
- if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
- || (strcmp (buf, "0x1.83p+0 33") != 0
- && strcmp (buf, "0x3.05p-1 33") != 0
- && strcmp (buf, "0x6.0ap-2 33") != 0
- && strcmp (buf, "0xc.14p-3 33") != 0))
- result |= 4;
- /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round. */
- if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0
- || (strcmp (buf, "0x2p+0 33") != 0
- && strcmp (buf, "0x3p-1 33") != 0
- && strcmp (buf, "0x6p-2 33") != 0
- && strcmp (buf, "0xcp-3 33") != 0))
- result |= 4;
- /* This catches a FreeBSD 6.1 bug. See
- <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
- if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
- || buf[0] == '0')
- result |= 8;
- /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */
- if (sprintf (buf, "%.1a", 1.999) < 0
- || (strcmp (buf, "0x1.0p+1") != 0
- && strcmp (buf, "0x2.0p+0") != 0
- && strcmp (buf, "0x4.0p-1") != 0
- && strcmp (buf, "0x8.0p-2") != 0))
- result |= 16;
- /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
- glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
- if (sprintf (buf, "%.1La", 1.999L) < 0
- || (strcmp (buf, "0x1.0p+1") != 0
- && strcmp (buf, "0x2.0p+0") != 0
- && strcmp (buf, "0x4.0p-1") != 0
- && strcmp (buf, "0x8.0p-2") != 0))
- result |= 32;
- return result;
-}]])],
- [gl_cv_func_printf_directive_a=yes],
- [gl_cv_func_printf_directive_a=no],
- [
- case "$host_os" in
- # Guess yes on glibc >= 2.5 systems.
- *-gnu* | gnu*)
- AC_EGREP_CPP([BZ2908], [
- #include <features.h>
- #ifdef __GNU_LIBRARY__
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__
- BZ2908
- #endif
- #endif
- ],
- [gl_cv_func_printf_directive_a="guessing yes"],
- [gl_cv_func_printf_directive_a="guessing no"])
- ;;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_printf_directive_a="guessing yes";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_directive_a="guessing no";;
- # Guess no on native Windows.
- mingw*) gl_cv_func_printf_directive_a="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_printf_directive_a="$gl_cross_guess_normal";;
- esac
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports the 'b' conversion
-dnl specifier for binary output of integers.
-dnl (ISO C23)
-dnl Result is gl_cv_func_printf_directive_b.
-
-AC_DEFUN([gl_PRINTF_DIRECTIVE_B],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports the 'b' directive],
- [gl_cv_func_printf_directive_b],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-int main ()
-{
- int result = 0;
- if (sprintf (buf, "%b %d", 12345, 33, 44, 55) < 0
- || strcmp (buf, "11000000111001 33") != 0)
- result |= 1;
- return result;
-}]])],
- [gl_cv_func_printf_directive_b=yes],
- [gl_cv_func_printf_directive_b=no],
- [
- case "$host_os" in
- # Guess yes on glibc >= 2.35 systems.
- *-gnu* | gnu*)
- AC_EGREP_CPP([Lucky], [
- #include <features.h>
- #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 35) || (__GLIBC__ > 2)
- Lucky user
- #endif
- #endif
- ],
- [gl_cv_func_printf_directive_uppercase_b="guessing yes"],
- [gl_cv_func_printf_directive_uppercase_b="guessing no"])
- ;;
- # Guess no on musl systems.
- *-musl* | midipix*) gl_cv_func_printf_directive_b="guessing no";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_directive_b="guessing no";;
- # Guess no on native Windows.
- mingw*) gl_cv_func_printf_directive_b="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_printf_directive_b="$gl_cross_guess_normal";;
- esac
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports the 'B' conversion
-dnl specifier for binary output of integers.
-dnl (GNU, encouraged by ISO C23 § 7.23.6.1)
-dnl Result is gl_cv_func_printf_directive_uppercase_b.
-
-AC_DEFUN([gl_PRINTF_DIRECTIVE_UPPERCASE_B],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports the 'B' directive],
- [gl_cv_func_printf_directive_uppercase_b],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-int main ()
-{
- int result = 0;
- if (sprintf (buf, "%#B %d", 12345, 33, 44, 55) < 0
- || strcmp (buf, "0B11000000111001 33") != 0)
- result |= 1;
- return result;
-}]])],
- [gl_cv_func_printf_directive_uppercase_b=yes],
- [gl_cv_func_printf_directive_uppercase_b=no],
- [
- case "$host_os" in
- # Guess yes on glibc >= 2.35 systems.
- *-gnu* | gnu*)
- AC_EGREP_CPP([Lucky], [
- #include <features.h>
- #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 35) || (__GLIBC__ > 2)
- Lucky user
- #endif
- #endif
- ],
- [gl_cv_func_printf_directive_uppercase_b="guessing yes"],
- [gl_cv_func_printf_directive_uppercase_b="guessing no"])
- ;;
- # Guess no on musl systems.
- *-musl* | midipix*) gl_cv_func_printf_directive_uppercase_b="guessing no";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_directive_uppercase_b="guessing no";;
- # Guess no on native Windows.
- mingw*) gl_cv_func_printf_directive_uppercase_b="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_printf_directive_uppercase_b="$gl_cross_guess_normal";;
- esac
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports the %F format
-dnl directive. (ISO C99, POSIX:2001)
-dnl Result is gl_cv_func_printf_directive_f.
-
-AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports the 'F' directive],
- [gl_cv_func_printf_directive_f],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-static double zero = 0.0;
-int main ()
-{
- int result = 0;
- if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
- || strcmp (buf, "1234567.000000 33") != 0)
- result |= 1;
- if (sprintf (buf, "%F", 1.0 / zero) < 0
- || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
- result |= 2;
- /* This catches a Cygwin 1.5.x bug. */
- if (sprintf (buf, "%.F", 1234.0) < 0
- || strcmp (buf, "1234") != 0)
- result |= 4;
- return result;
-}]])],
- [gl_cv_func_printf_directive_f=yes],
- [gl_cv_func_printf_directive_f=no],
- [
- case "$host_os" in
-changequote(,)dnl
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_printf_directive_f="guessing yes";;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_printf_directive_f="guessing yes";;
- # Guess yes on FreeBSD >= 6.
- freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";;
- freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
- midnightbsd*) gl_cv_func_printf_directive_f="guessing yes";;
- # Guess yes on Mac OS X >= 10.3.
- darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
- darwin*) gl_cv_func_printf_directive_f="guessing yes";;
- # Guess yes on OpenBSD >= 6.0.
- openbsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";;
- openbsd*) gl_cv_func_printf_directive_f="guessing yes";;
- # Guess yes on Solaris >= 2.10.
- solaris2.[1-9][0-9]*) gl_cv_func_printf_directive_f="guessing yes";;
- solaris*) gl_cv_func_printf_directive_f="guessing no";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_directive_f="guessing no";;
-changequote([,])dnl
- # Guess yes on MSVC, no on mingw.
- mingw*) AC_EGREP_CPP([Known], [
-#ifdef _MSC_VER
- Known
-#endif
- ],
- [gl_cv_func_printf_directive_f="guessing yes"],
- [gl_cv_func_printf_directive_f="guessing no"])
- ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_printf_directive_f="$gl_cross_guess_normal";;
- esac
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports the %n format
-dnl directive. (ISO C99, POSIX:2001)
-dnl Result is gl_cv_func_printf_directive_n.
-
-AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports the 'n' directive],
- [gl_cv_func_printf_directive_n],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef _MSC_VER
-#include <inttypes.h>
-/* See page about "Parameter Validation" on msdn.microsoft.com.
- <https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation>
- <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler> */
-static void cdecl
-invalid_parameter_handler (const wchar_t *expression,
- const wchar_t *function,
- const wchar_t *file, unsigned int line,
- uintptr_t dummy)
-{
- exit (1);
-}
-#endif
-static char fmtstring[10];
-static char buf[100];
-int main ()
-{
- int count = -1;
-#ifdef _MSC_VER
- _set_invalid_parameter_handler (invalid_parameter_handler);
-#endif
- /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
- support %n in format strings in read-only memory but not in writable
- memory. */
- strcpy (fmtstring, "%d %n");
- if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
- || strcmp (buf, "123 ") != 0
- || count != 4)
- return 1;
- return 0;
-}]])],
- [gl_cv_func_printf_directive_n=yes],
- [gl_cv_func_printf_directive_n=no],
- [case "$host_os" in
- # Guess no on glibc when _FORTIFY_SOURCE >= 2.
- *-gnu* | gnu*) AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if _FORTIFY_SOURCE >= 2
- error fail
- #endif
- ]])],
- [gl_cv_func_printf_directive_n="guessing yes"],
- [gl_cv_func_printf_directive_n="guessing no"])
- ;;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_directive_n="guessing no";;
- # Guess no on native Windows.
- mingw*) gl_cv_func_printf_directive_n="guessing no";;
- *) gl_cv_func_printf_directive_n="guessing yes";;
- esac
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports the %ls format
-dnl directive and in particular, when a precision is specified, whether
-dnl the functions stop converting the wide string argument when the number
-dnl of bytes that have been produced by this conversion equals or exceeds
-dnl the precision.
-dnl Result is gl_cv_func_printf_directive_ls.
-
-AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports the 'ls' directive],
- [gl_cv_func_printf_directive_ls],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <wchar.h>
-#include <string.h>
-int main ()
-{
- int result = 0;
- char buf[100];
- /* Test whether %ls works at all.
- This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
- Cygwin 1.5. */
- {
- static const wchar_t wstring[] = { 'a', 'b', 'c', 0 };
- buf[0] = '\0';
- if (sprintf (buf, "%ls", wstring) < 0
- || strcmp (buf, "abc") != 0)
- result |= 1;
- }
- /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
- assertion failure inside libc), but not on OpenBSD 4.0. */
- {
- static const wchar_t wstring[] = { 'a', 0 };
- buf[0] = '\0';
- if (sprintf (buf, "%ls", wstring) < 0
- || strcmp (buf, "a") != 0)
- result |= 2;
- }
- /* Test whether precisions in %ls are supported as specified in ISO C 99
- section 7.19.6.1:
- "If a precision is specified, no more than that many bytes are written
- (including shift sequences, if any), and the array shall contain a
- null wide character if, to equal the multibyte character sequence
- length given by the precision, the function would need to access a
- wide character one past the end of the array."
- This test fails on Solaris 10. */
- {
- static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 };
- buf[0] = '\0';
- if (sprintf (buf, "%.2ls", wstring) < 0
- || strcmp (buf, "ab") != 0)
- result |= 8;
- }
- return result;
-}]])],
- [gl_cv_func_printf_directive_ls=yes],
- [gl_cv_func_printf_directive_ls=no],
- [
-changequote(,)dnl
- case "$host_os" in
- # Guess yes on OpenBSD >= 6.0.
- openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";;
- openbsd*) gl_cv_func_printf_directive_ls="guessing yes";;
- irix*) gl_cv_func_printf_directive_ls="guessing no";;
- solaris*) gl_cv_func_printf_directive_ls="guessing no";;
- cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
- beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_directive_ls="guessing no";;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_printf_directive_ls="guessing yes";;
- *) gl_cv_func_printf_directive_ls="guessing yes";;
- esac
-changequote([,])dnl
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports the %lc format
-dnl directive and in particular, when the argument is a null wide character,
-dnl whether the functions don't produce a NUL byte.
-dnl Result is gl_cv_func_printf_directive_lc.
-
-AC_DEFUN([gl_PRINTF_DIRECTIVE_LC],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports the 'lc' directive correctly],
- [gl_cv_func_printf_directive_lc],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <wchar.h>
-#include <string.h>
-int main ()
-{
- int result = 0;
- char buf[100];
- /* This test fails on glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
- macOS 12.5, AIX 7.2, Solaris 11.4.
- glibc 2.35 bug: <https://sourceware.org/bugzilla/show_bug.cgi?id=30257> */
- {
- buf[0] = '\0';
- if (sprintf (buf, "%lc%lc%lc", (wint_t) 'a', (wint_t) 0, (wint_t) 'z') < 0
- || strcmp (buf, "az") != 0)
- result |= 1;
- }
- return result;
-}]])],
- [gl_cv_func_printf_directive_lc=yes],
- [gl_cv_func_printf_directive_lc=no],
- [
-changequote(,)dnl
- case "$host_os" in
- # Guess yes on musl libc.
- *-musl* | midipix*) gl_cv_func_printf_directive_lc="guessing yes";;
- # Guess no otherwise.
- *) gl_cv_func_printf_directive_lc="guessing no";;
- esac
-changequote([,])dnl
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports POSIX/XSI format
-dnl strings with positions. (POSIX:2001)
-dnl Result is gl_cv_func_printf_positions.
-
-AC_DEFUN_ONCE([gl_PRINTF_POSITIONS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
- [gl_cv_func_printf_positions],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-/* The string "%2$d %1$d", with dollar characters protected from the shell's
- dollar expansion (possibly an autoconf bug). */
-static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
-static char buf[100];
-int main ()
-{
- sprintf (buf, format, 33, 55);
- return (strcmp (buf, "55 33") != 0);
-}]])],
- [gl_cv_func_printf_positions=yes],
- [gl_cv_func_printf_positions=no],
- [
-changequote(,)dnl
- case "$host_os" in
- netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
- gl_cv_func_printf_positions="guessing no";;
- beos*) gl_cv_func_printf_positions="guessing no";;
- # Guess yes on Android.
- linux*-android*) gl_cv_func_printf_positions="guessing yes";;
- # Guess no on native Windows.
- mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
- *) gl_cv_func_printf_positions="guessing yes";;
- esac
-changequote([,])dnl
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports POSIX/XSI format
-dnl strings with the ' flag for grouping of decimal digits. (POSIX:2001)
-dnl Result is gl_cv_func_printf_flag_grouping.
-
-AC_DEFUN([gl_PRINTF_FLAG_GROUPING],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports the grouping flag],
- [gl_cv_func_printf_flag_grouping],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-int main ()
-{
- if (sprintf (buf, "%'d %d", 1234567, 99) < 0
- || buf[strlen (buf) - 1] != '9')
- return 1;
- return 0;
-}]])],
- [gl_cv_func_printf_flag_grouping=yes],
- [gl_cv_func_printf_flag_grouping=no],
- [
-changequote(,)dnl
- case "$host_os" in
- cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
- netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";;
- # Guess no on native Windows.
- mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
- *) gl_cv_func_printf_flag_grouping="guessing yes";;
- esac
-changequote([,])dnl
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports the - flag correctly.
-dnl (ISO C99.) See
-dnl <https://lists.gnu.org/r/bug-coreutils/2008-02/msg00035.html>
-dnl Result is gl_cv_func_printf_flag_leftadjust.
-
-AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
- [gl_cv_func_printf_flag_leftadjust],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-int main ()
-{
- /* Check that a '-' flag is not annihilated by a negative width. */
- if (sprintf (buf, "a%-*sc", -3, "b") < 0
- || strcmp (buf, "ab c") != 0)
- return 1;
- return 0;
-}]])],
- [gl_cv_func_printf_flag_leftadjust=yes],
- [gl_cv_func_printf_flag_leftadjust=no],
- [
-changequote(,)dnl
- case "$host_os" in
- # Guess yes on HP-UX 11.
- hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
- # Guess no on HP-UX 10 and older.
- hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";;
- # Guess yes on Android.
- linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
- # Guess yes otherwise.
- *) gl_cv_func_printf_flag_leftadjust="guessing yes";;
- esac
-changequote([,])dnl
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports padding of non-finite
-dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See
-dnl <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html>
-dnl Result is gl_cv_func_printf_flag_zero.
-
-AC_DEFUN([gl_PRINTF_FLAG_ZERO],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports the zero flag correctly],
- [gl_cv_func_printf_flag_zero],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-static double zero = 0.0;
-int main ()
-{
- if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0
- || (strcmp (buf, " inf") != 0
- && strcmp (buf, " infinity") != 0))
- return 1;
- return 0;
-}]])],
- [gl_cv_func_printf_flag_zero=yes],
- [gl_cv_func_printf_flag_zero=no],
- [
-changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_printf_flag_zero="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_printf_flag_zero="guessing yes";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_flag_zero="guessing no";;
- # Guess no on native Windows.
- mingw*) gl_cv_func_printf_flag_zero="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";;
- esac
-changequote([,])dnl
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions supports large precisions.
-dnl On mingw, precisions larger than 512 are treated like 512, in integer,
-dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
-dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC,
-dnl precisions larger than 510 in floating-point output yield wrong results.
-dnl On AIX 7.1, precisions larger than 998 in floating-point output yield
-dnl wrong results. On BeOS, precisions larger than 1044 crash the program.
-dnl Result is gl_cv_func_printf_precision.
-
-AC_DEFUN([gl_PRINTF_PRECISION],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf supports large precisions],
- [gl_cv_func_printf_precision],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-static char buf[5000];
-int main ()
-{
- int result = 0;
-#ifdef __BEOS__
- /* On BeOS, this would crash and show a dialog box. Avoid the crash. */
- return 1;
-#endif
- if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
- result |= 1;
- if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
- result |= 2;
- if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
- || buf[0] != '1')
- result |= 4;
- if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5
- || buf[0] != '1')
- result |= 4;
- return result;
-}]])],
- [gl_cv_func_printf_precision=yes],
- [gl_cv_func_printf_precision=no],
- [
-changequote(,)dnl
- case "$host_os" in
- # Guess no only on Solaris, native Windows, and BeOS systems.
- solaris*) gl_cv_func_printf_precision="guessing no" ;;
- mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
- beos*) gl_cv_func_printf_precision="guessing no" ;;
- # Guess yes on Android.
- linux*-android*) gl_cv_func_printf_precision="guessing yes" ;;
- *) gl_cv_func_printf_precision="guessing yes" ;;
- esac
-changequote([,])dnl
- ])
- ])
-])
-
-dnl Test whether the *printf family of functions recovers gracefully in case
-dnl of an out-of-memory condition, or whether it crashes the entire program.
-dnl Result is gl_cv_func_printf_enomem.
-
-AC_DEFUN([gl_PRINTF_ENOMEM],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([gl_MULTIARCH])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether printf survives out-of-memory conditions],
- [gl_cv_func_printf_enomem],
- [
- gl_cv_func_printf_enomem="guessing no"
- if test "$cross_compiling" = no; then
- if test $APPLE_UNIVERSAL_BUILD = 0; then
- AC_LANG_CONFTEST([AC_LANG_SOURCE([[
-]GL_NOCRASH[
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <errno.h>
-int main()
-{
- struct rlimit limit;
- int ret;
- nocrash_init ();
- /* Some printf implementations allocate temporary space with malloc. */
- /* On BSD systems, malloc() is limited by RLIMIT_DATA. */
-#ifdef RLIMIT_DATA
- if (getrlimit (RLIMIT_DATA, &limit) < 0)
- return 77;
- if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
- limit.rlim_max = 5000000;
- limit.rlim_cur = limit.rlim_max;
- if (setrlimit (RLIMIT_DATA, &limit) < 0)
- return 77;
-#endif
- /* On Linux systems, malloc() is limited by RLIMIT_AS. */
-#ifdef RLIMIT_AS
- if (getrlimit (RLIMIT_AS, &limit) < 0)
- return 77;
- if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
- limit.rlim_max = 5000000;
- limit.rlim_cur = limit.rlim_max;
- if (setrlimit (RLIMIT_AS, &limit) < 0)
- return 77;
-#endif
- /* Some printf implementations allocate temporary space on the stack. */
-#ifdef RLIMIT_STACK
- if (getrlimit (RLIMIT_STACK, &limit) < 0)
- return 77;
- if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
- limit.rlim_max = 5000000;
- limit.rlim_cur = limit.rlim_max;
- if (setrlimit (RLIMIT_STACK, &limit) < 0)
- return 77;
-#endif
- ret = printf ("%.5000000f", 1.0);
- return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
-}
- ]])])
- if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
- (./conftest 2>&AS_MESSAGE_LOG_FD
- result=$?
- _AS_ECHO_LOG([\$? = $result])
- if test $result != 0 && test $result != 77; then result=1; fi
- exit $result
- ) >/dev/null 2>/dev/null
- case $? in
- 0) gl_cv_func_printf_enomem="yes" ;;
- 77) gl_cv_func_printf_enomem="guessing no" ;;
- *) gl_cv_func_printf_enomem="no" ;;
- esac
- else
- gl_cv_func_printf_enomem="guessing no"
- fi
- rm -fr conftest*
- else
- dnl A universal build on Apple Mac OS X platforms.
- dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
- dnl But we need a configuration result that is valid in both modes.
- gl_cv_func_printf_enomem="guessing no"
- fi
- fi
- if test "$gl_cv_func_printf_enomem" = "guessing no"; then
-changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on Solaris.
- solaris*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on AIX.
- aix*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on HP-UX/hppa.
- hpux*) case "$host_cpu" in
- hppa*) gl_cv_func_printf_enomem="guessing yes";;
- *) gl_cv_func_printf_enomem="guessing no";;
- esac
- ;;
- # Guess yes on IRIX.
- irix*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on OSF/1.
- osf*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on Haiku.
- haiku*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_enomem="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_printf_enomem="$gl_cross_guess_normal";;
- esac
-changequote([,])dnl
- fi
- ])
-])
-
-dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001)
-dnl Result is ac_cv_func_snprintf.
-
-AC_DEFUN([gl_SNPRINTF_PRESENCE],
-[
- AC_CHECK_FUNCS_ONCE([snprintf])
-])
-
-dnl Test whether the string produced by the snprintf function is always NUL
-dnl terminated. (ISO C99, POSIX:2001)
-dnl Result is gl_cv_func_snprintf_truncation_c99.
-
-AC_DEFUN_ONCE([gl_SNPRINTF_TRUNCATION_C99],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_SNPRINTF_PRESENCE])
- AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
- [gl_cv_func_snprintf_truncation_c99],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-#if HAVE_SNPRINTF
-# define my_snprintf snprintf
-#else
-# include <stdarg.h>
-static int my_snprintf (char *buf, int size, const char *format, ...)
-{
- va_list args;
- int ret;
- va_start (args, format);
- ret = vsnprintf (buf, size, format, args);
- va_end (args);
- return ret;
-}
-#endif
-static char buf[100];
-int main ()
-{
- strcpy (buf, "ABCDEF");
- my_snprintf (buf, 3, "%d %d", 4567, 89);
- if (memcmp (buf, "45\0DEF", 6) != 0)
- return 1;
- return 0;
-}]])],
- [gl_cv_func_snprintf_truncation_c99=yes],
- [gl_cv_func_snprintf_truncation_c99=no],
- [
-changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on FreeBSD >= 5.
- freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
- freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- midnightbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on Mac OS X >= 10.3.
- darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
- darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on OpenBSD >= 3.9.
- openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
- gl_cv_func_snprintf_truncation_c99="guessing no";;
- openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on Solaris >= 2.6.
- solaris2.[0-5] | solaris2.[0-5].*)
- gl_cv_func_snprintf_truncation_c99="guessing no";;
- solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on AIX >= 4.
- aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
- aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on HP-UX >= 11.
- hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
- hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on IRIX >= 6.5.
- irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on OSF/1 >= 5.
- osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
- osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_snprintf_truncation_c99="guessing no";;
- netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on Android.
- linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess no on native Windows.
- mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";;
- esac
-changequote([,])dnl
- ])
- ])
-])
-
-dnl Test whether the return value of the snprintf function is the number
-dnl of bytes (excluding the terminating NUL) that would have been produced
-dnl if the buffer had been large enough. (ISO C99, POSIX:2001)
-dnl For example, this test program fails on IRIX 6.5:
-dnl ---------------------------------------------------------------------
-dnl #include <stdio.h>
-dnl int main()
-dnl {
-dnl static char buf[8];
-dnl int retval = snprintf (buf, 3, "%d", 12345);
-dnl return retval >= 0 && retval < 3;
-dnl }
-dnl ---------------------------------------------------------------------
-dnl Result is gl_cv_func_snprintf_retval_c99.
-
-AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_SNPRINTF_PRESENCE])
- AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
- [gl_cv_func_snprintf_retval_c99],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-#if HAVE_SNPRINTF
-# define my_snprintf snprintf
-#else
-# include <stdarg.h>
-static int my_snprintf (char *buf, int size, const char *format, ...)
-{
- va_list args;
- int ret;
- va_start (args, format);
- ret = vsnprintf (buf, size, format, args);
- va_end (args);
- return ret;
-}
-#endif
-static char buf[100];
-int main ()
-{
- strcpy (buf, "ABCDEF");
- if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7)
- return 1;
- if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7)
- return 2;
- if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
- return 3;
- return 0;
-}]])],
- [gl_cv_func_snprintf_retval_c99=yes],
- [gl_cv_func_snprintf_retval_c99=no],
- [case "$host_os" in
-changequote(,)dnl
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on FreeBSD >= 5.
- freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";;
- freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- midnightbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on Mac OS X >= 10.3.
- darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
- darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on OpenBSD >= 3.9.
- openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
- gl_cv_func_snprintf_retval_c99="guessing no";;
- openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on Solaris >= 2.10.
- solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
- solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
- # Guess yes on AIX >= 4.
- aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
- aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_snprintf_retval_c99="guessing no";;
- netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on Android.
- linux*-android*) gl_cv_func_snprintf_retval_c99="guessing yes";;
-changequote([,])dnl
- # Guess yes on MSVC, no on mingw.
- mingw*) AC_EGREP_CPP([Known], [
-#ifdef _MSC_VER
- Known
-#endif
- ],
- [gl_cv_func_snprintf_retval_c99="guessing yes"],
- [gl_cv_func_snprintf_retval_c99="guessing no"])
- ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_snprintf_retval_c99="$gl_cross_guess_normal";;
- esac
- ])
- ])
-])
-
-dnl Test whether the snprintf function supports the %n format directive
-dnl also in truncated portions of the format string. (ISO C99, POSIX:2001)
-dnl Result is gl_cv_func_snprintf_directive_n.
-
-AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_SNPRINTF_PRESENCE])
- AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
- [gl_cv_func_snprintf_directive_n],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <string.h>
-#if HAVE_SNPRINTF
-# define my_snprintf snprintf
-#else
-# include <stdarg.h>
-static int my_snprintf (char *buf, int size, const char *format, ...)
-{
- va_list args;
- int ret;
- va_start (args, format);
- ret = vsnprintf (buf, size, format, args);
- va_end (args);
- return ret;
-}
-#endif
-static char fmtstring[10];
-static char buf[100];
-int main ()
-{
- int count = -1;
- /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
- support %n in format strings in read-only memory but not in writable
- memory. */
- strcpy (fmtstring, "%d %n");
- my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
- if (count != 6)
- return 1;
- return 0;
-}]])],
- [gl_cv_func_snprintf_directive_n=yes],
- [gl_cv_func_snprintf_directive_n=no],
- [
- case "$host_os" in
- # Guess no on glibc when _FORTIFY_SOURCE >= 2.
- *-gnu* | gnu*) AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#if _FORTIFY_SOURCE >= 2
- error fail
- #endif
- ]])],
- [gl_cv_func_snprintf_directive_n="guessing yes"],
- [gl_cv_func_snprintf_directive_n="guessing no"])
- ;;
-changequote(,)dnl
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on FreeBSD >= 5.
- freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";;
- freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
- midnightbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on Mac OS X >= 10.3.
- darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
- darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on Solaris >= 2.6.
- solaris2.[0-5] | solaris2.[0-5].*)
- gl_cv_func_snprintf_directive_n="guessing no";;
- solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on AIX >= 4.
- aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
- aix*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on IRIX >= 6.5.
- irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on OSF/1 >= 5.
- osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
- osf*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_snprintf_directive_n="guessing no";;
- netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_snprintf_directive_n="guessing no";;
- # Guess no on native Windows.
- mingw*) gl_cv_func_snprintf_directive_n="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";;
-changequote([,])dnl
- esac
- ])
- ])
-])
-
-dnl Test whether the snprintf function, when passed a size = 1, writes any
-dnl output without bounds in this case, behaving like sprintf. This is the
-dnl case on Linux libc5.
-dnl Result is gl_cv_func_snprintf_size1.
-
-AC_DEFUN([gl_SNPRINTF_SIZE1],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_SNPRINTF_PRESENCE])
- AC_CACHE_CHECK([whether snprintf respects a size of 1],
- [gl_cv_func_snprintf_size1],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#if HAVE_SNPRINTF
-# define my_snprintf snprintf
-#else
-# include <stdarg.h>
-static int my_snprintf (char *buf, int size, const char *format, ...)
-{
- va_list args;
- int ret;
- va_start (args, format);
- ret = vsnprintf (buf, size, format, args);
- va_end (args);
- return ret;
-}
-#endif
-int main()
-{
- static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
- my_snprintf (buf, 1, "%d", 12345);
- return buf[1] != 'E';
-}]])],
- [gl_cv_func_snprintf_size1=yes],
- [gl_cv_func_snprintf_size1=no],
- [case "$host_os" in
- # Guess yes on Android.
- linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_snprintf_size1="guessing yes" ;;
- *) gl_cv_func_snprintf_size1="guessing yes" ;;
- esac
- ])
- ])
-])
-
-dnl Test whether the vsnprintf function, when passed a zero size, produces no
-dnl output. (ISO C99, POSIX:2001)
-dnl For example, snprintf nevertheless writes a NUL byte in this case
-dnl on OSF/1 5.1:
-dnl ---------------------------------------------------------------------
-dnl #include <stdio.h>
-dnl int main()
-dnl {
-dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
-dnl snprintf (buf, 0, "%d", 12345);
-dnl return buf[0] != 'D';
-dnl }
-dnl ---------------------------------------------------------------------
-dnl And vsnprintf writes any output without bounds in this case, behaving like
-dnl vsprintf, on HP-UX 11 and OSF/1 5.1:
-dnl ---------------------------------------------------------------------
-dnl #include <stdarg.h>
-dnl #include <stdio.h>
-dnl static int my_snprintf (char *buf, int size, const char *format, ...)
-dnl {
-dnl va_list args;
-dnl int ret;
-dnl va_start (args, format);
-dnl ret = vsnprintf (buf, size, format, args);
-dnl va_end (args);
-dnl return ret;
-dnl }
-dnl int main()
-dnl {
-dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
-dnl my_snprintf (buf, 0, "%d", 12345);
-dnl return buf[0] != 'D';
-dnl }
-dnl ---------------------------------------------------------------------
-dnl Result is gl_cv_func_vsnprintf_zerosize_c99.
-
-AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
- [gl_cv_func_vsnprintf_zerosize_c99],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdarg.h>
-#include <stdio.h>
-static int my_snprintf (char *buf, int size, const char *format, ...)
-{
- va_list args;
- int ret;
- va_start (args, format);
- ret = vsnprintf (buf, size, format, args);
- va_end (args);
- return ret;
-}
-int main()
-{
- static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
- my_snprintf (buf, 0, "%d", 12345);
- return buf[0] != 'D';
-}]])],
- [gl_cv_func_vsnprintf_zerosize_c99=yes],
- [gl_cv_func_vsnprintf_zerosize_c99=no],
- [
-changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on FreeBSD >= 5.
- freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
- freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- midnightbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on Mac OS X >= 10.3.
- darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
- darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on Cygwin.
- cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on Solaris >= 2.6.
- solaris2.[0-5] | solaris2.[0-5].*)
- gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
- solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on AIX >= 4.
- aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
- aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on IRIX >= 6.5.
- irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
- netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on Android.
- linux*-android*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on native Windows.
- mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";;
- esac
-changequote([,])dnl
- ])
- ])
-])
-
-dnl Test whether the swprintf function works correctly when it produces output
-dnl that contains null wide characters.
-dnl Result is gl_cv_func_swprintf_works.
-
-AC_DEFUN([gl_SWPRINTF_WORKS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CHECK_FUNCS_ONCE([swprintf])
- AC_CACHE_CHECK([whether swprintf works],
- [gl_cv_func_swprintf_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#ifndef __USE_MINGW_ANSI_STDIO
-# define __USE_MINGW_ANSI_STDIO 1
-#endif
-#include <stdio.h>
-#include <wchar.h>
-int main()
-{
- int result = 0;
- { /* This test fails on musl libc 1.2.3, FreeBSD, NetBSD, OpenBSD, macOS, AIX. */
- wchar_t buf[5] = { 0xBEEF, 0xBEEF, 0xBEEF, 0xBEEF, 0xBEEF };
- int ret = swprintf (buf, 4, L"%cz", '\0');
- /* Expected result:
- ret = 2, buf[0] = 0x0, buf[1] = 0x7a, buf[2] = 0x0, buf[3] = 0xbeef
- musl libc 1.2.3:
- ret = 2, buf[0] = 0x0, buf[1] = 0x0, buf[2] = 0x0, buf[3] = 0x0
- Reported at <https://www.openwall.com/lists/musl/2023/03/22/9>.
- FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2:
- ret = 2, buf[0] = 0x0, buf[1] = 0xbeef, buf[2] = 0xbeef, buf[3] = 0xbeef
- */
- if (ret < 0 || buf[1] != 'z')
- result |= 1;
- }
- { /* This test fails on mingw. */
- wchar_t buf[2];
- int ret = swprintf (buf, 2, L"%lc", (wint_t)0);
- /* Expected: ret = 1
- mingw: ret = 0
- */
- if (ret != 1)
- result |= 2;
- }
- return result;
-}]])],
- [gl_cv_func_swprintf_works=yes],
- [gl_cv_func_swprintf_works=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_swprintf_works="guessing yes";;
- # Guess no on musl systems.
- *-musl* | midipix*) gl_cv_func_swprintf_works="guessing no";;
- # Guess no on FreeBSD, NetBSD, OpenBSD, macOS, AIX.
- freebsd* | midnightbsd* | netbsd* | openbsd* | darwin* | aix*)
- gl_cv_func_swprintf_works="guessing no";;
- # Guess no on native Windows.
- mingw* | pw*) gl_cv_func_swprintf_works="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_swprintf_works="$gl_cross_guess_normal";;
- esac
- ])
- ])
-])
-
-dnl Test whether the *wprintf family of functions supports the 'a' and 'A'
-dnl conversion specifier for hexadecimal output of 'long double' numbers.
-dnl (ISO C99, POSIX:2001)
-dnl Result is gl_cv_func_swprintf_directive_la.
-
-AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LA],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether swprintf supports the 'La' and 'LA' directives],
- [gl_cv_func_swprintf_directive_la],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <wchar.h>
-static wchar_t buf[100];
-int main ()
-{
- int result = 0;
- /* This catches a glibc 2.15 and Haiku 2022 bug. */
- if (swprintf (buf, sizeof (buf) / sizeof (wchar_t),
- L"%La %d", 3.1416015625L, 33, 44, 55) < 0
- || (wcscmp (buf, L"0x1.922p+1 33") != 0
- && wcscmp (buf, L"0x3.244p+0 33") != 0
- && wcscmp (buf, L"0x6.488p-1 33") != 0
- && wcscmp (buf, L"0xc.91p-2 33") != 0))
- result |= 1;
- return result;
-}]])],
- [gl_cv_func_swprintf_directive_la=yes],
- [gl_cv_func_swprintf_directive_la=no],
- [case "$host_os" in
- # Guess yes on glibc >= 2.17 systems.
- *-gnu* | gnu*)
- AC_EGREP_CPP([Unlucky], [
- #include <features.h>
- #ifdef __GNU_LIBRARY__
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16) || (__GLIBC__ > 2)) && !defined __UCLIBC__
- Unlucky
- #endif
- #endif
- ],
- [gl_cv_func_swprintf_directive_la="guessing yes"],
- [gl_cv_func_swprintf_directive_la="guessing no"])
- ;;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_swprintf_directive_la="guessing yes";;
- # Guess yes on Android.
- linux*-android*) gl_cv_func_swprintf_directive_la="guessing yes";;
- # Guess no on native Windows.
- mingw*) gl_cv_func_swprintf_directive_la="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_swprintf_directive_la="$gl_cross_guess_normal";;
- esac
- ])
- ])
-])
-
-dnl Test whether the *wprintf family of functions supports the 'lc' conversion
-dnl specifier for all wide characters.
-dnl (ISO C11, POSIX:2001)
-dnl Result is gl_cv_func_swprintf_directive_lc.
-
-AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LC],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether swprintf supports the 'lc' directive],
- [gl_cv_func_swprintf_directive_lc],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <wchar.h>
-static wchar_t buf[100];
-static wint_t L_invalid = (wchar_t) 0x76543210;
-int main ()
-{
- int result = 0;
- /* This catches a musl libc 1.2.4, Android bug.
- Reported at <https://www.openwall.com/lists/musl/2023/06/12/3>. */
- if (swprintf (buf, sizeof (buf) / sizeof (wchar_t),
- L"%lc %d", L_invalid, 33, 44, 55) < 0)
- result |= 1;
- return result;
-}]])],
- [gl_cv_func_swprintf_directive_lc=yes],
- [gl_cv_func_swprintf_directive_lc=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_swprintf_directive_lc="guessing yes";;
- # Guess no on musl systems.
- *-musl* | midipix*) gl_cv_func_swprintf_directive_lc="guessing no";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_swprintf_directive_lc="guessing no";;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_swprintf_directive_lc="guessing yes";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_swprintf_directive_lc="$gl_cross_guess_normal";;
- esac
- ])
- ])
-])
-
-dnl The results of these tests on various platforms are:
-dnl
-dnl 1 = gl_PRINTF_SIZES_C99
-dnl 2 = gl_PRINTF_SIZES_C23
-dnl 3 = gl_PRINTF_LONG_DOUBLE
-dnl 4 = gl_PRINTF_INFINITE
-dnl 5 = gl_PRINTF_INFINITE_LONG_DOUBLE
-dnl 6 = gl_PRINTF_DIRECTIVE_A
-dnl 7 = gl_PRINTF_DIRECTIVE_B
-dnl 8 = gl_PRINTF_DIRECTIVE_UPPERCASE_B
-dnl 9 = gl_PRINTF_DIRECTIVE_F
-dnl 10 = gl_PRINTF_DIRECTIVE_N
-dnl 11 = gl_PRINTF_DIRECTIVE_LS
-dnl 12 = gl_PRINTF_DIRECTIVE_LC
-dnl 13 = gl_PRINTF_POSITIONS
-dnl 14 = gl_PRINTF_FLAG_GROUPING
-dnl 15 = gl_PRINTF_FLAG_LEFTADJUST
-dnl 16 = gl_PRINTF_FLAG_ZERO
-dnl 17 = gl_PRINTF_PRECISION
-dnl 18 = gl_PRINTF_ENOMEM
-dnl 19 = gl_SNPRINTF_PRESENCE
-dnl 20 = gl_SNPRINTF_TRUNCATION_C99
-dnl 21 = gl_SNPRINTF_RETVAL_C99
-dnl 22 = gl_SNPRINTF_DIRECTIVE_N
-dnl 23 = gl_SNPRINTF_SIZE1
-dnl 24 = gl_VSNPRINTF_ZEROSIZE_C99
-dnl 25 = gl_SWPRINTF_WORKS
-dnl 26 = gl_SWPRINTF_DIRECTIVE_LA
-dnl 27 = gl_SWPRINTF_DIRECTIVE_LC
-dnl
-dnl 1 = checking whether printf supports size specifiers as in C99...
-dnl 2 = checking whether printf supports size specifiers as in C23...
-dnl 3 = checking whether printf supports 'long double' arguments...
-dnl 4 = checking whether printf supports infinite 'double' arguments...
-dnl 5 = checking whether printf supports infinite 'long double' arguments...
-dnl 6 = checking whether printf supports the 'a' and 'A' directives...
-dnl 7 = checking whether printf supports the 'b' directive...
-dnl 8 = checking whether printf supports the 'B' directive...
-dnl 9 = checking whether printf supports the 'F' directive...
-dnl 10 = checking whether printf supports the 'n' directive...
-dnl 11 = checking whether printf supports the 'ls' directive...
-dnl 12 = checking whether printf supports the 'lc' directive correctly...
-dnl 13 = checking whether printf supports POSIX/XSI format strings with positions...
-dnl 14 = checking whether printf supports the grouping flag...
-dnl 15 = checking whether printf supports the left-adjust flag correctly...
-dnl 16 = checking whether printf supports the zero flag correctly...
-dnl 17 = checking whether printf supports large precisions...
-dnl 18 = checking whether printf survives out-of-memory conditions...
-dnl 19 = checking for snprintf...
-dnl 20 = checking whether snprintf truncates the result as in C99...
-dnl 21 = checking whether snprintf returns a byte count as in C99...
-dnl 22 = checking whether snprintf fully supports the 'n' directive...
-dnl 23 = checking whether snprintf respects a size of 1...
-dnl 24 = checking whether vsnprintf respects a zero size as in C99...
-dnl 25 = checking whether swprintf works...
-dnl 26 = checking whether swprintf supports the 'La' and 'LA' directives...
-dnl 27 = checking whether swprintf supports the 'lc' directive...
-dnl
-dnl . = yes, # = no.
-dnl
-dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
-dnl musl libc 1.2.3 . # . . . . # # . . . . . . . . . . . . . . . . # . #
-dnl glibc 2.35 . # . . . . . . . . . # . . . . . . . . . . . . . . .
-dnl glibc 2.5 . # . . . . # # . . . # . . . . . . . . . . . . . # .
-dnl glibc 2.3.6 . # . . . # # # . . . # . . . . . . . . . . . . . # .
-dnl FreeBSD 13.0 . # . . . # # # . . . # . . . . . # . . . . . . # . #
-dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . # . . . # . # . . . . . . # ? ?
-dnl Mac OS X 10.13.5 . # . . # # # # . # . # . . . . . . . . . # . . # ? ?
-dnl Mac OS X 10.5.8 . # . . # # # # . . . # . . . # . . . . . . . . # ? ?
-dnl Mac OS X 10.3.9 . # . . . # # # . . . # . . . # . # . . . . . . # ? ?
-dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . # . . . . . # . . . . . . # . #
-dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # # . # . # . # . . . . . . # ? ?
-dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . . . . . ? . . . . . . ? ? ?
-dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . . . . . # . . . . . . ? ? ?
-dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . # . # # # . . . . . . ? ? ?
-dnl Solaris 11.4 . # . # # # # # . . # # . . . # . . . . . . . . . # .
-dnl Solaris 11.3 . # . . . # # # . . # # . . . . . . . . . . . . . # .
-dnl Solaris 11.0 . # . # # # # # . . # # . . . # . . . . . . . . ? ? ?
-dnl Solaris 10 . # . # # # # # . . # # . . . # # . . . . . . . . # .
-dnl Solaris 2.6 ... 9 # # . # # # # # # . # # . . . # # . . . # . . . ? ? ?
-dnl Solaris 2.5.1 # # . # # # # # # . # # . . . # . . # # # # # # ? ? ?
-dnl AIX 7.1 . # . # # # # # . . . # . . . # # . . . . . . . # . .
-dnl AIX 5.2 . # . # # # # # . . . # . . . # . . . . . . . . # ? ?
-dnl AIX 4.3.2, 5.1 # # . # # # # # # . . # . . . # . . . . # . . . # ? ?
-dnl HP-UX 11.31 . # . . . # # # . . . ? . . . # . . . . # # . . ? ? ?
-dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . . . # . . . . # # . # ? ? ?
-dnl HP-UX 10.20 # # . # . # # # # . ? ? . . # # . . . . # # ? # ? ? ?
-dnl IRIX 6.5 # # . # # # # # # . # # . . . # . . . . # . . . # ? ?
-dnl OSF/1 5.1 # # . # # # # # # . . ? . . . # . . . . # . . # ? ? ?
-dnl OSF/1 4.0d # # . # # # # # # . . ? . . . # . . # # # # # # ? ? ?
-dnl NetBSD 9.0 . # . . . # # # . . . # . . . . . . . . . . . . # . #
-dnl NetBSD 5.0 . # . . # # # # . . . # . . . # . # . . . . . . # ? ?
-dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? # . ? ? ? ? ? . . . ? ? ? # ? ?
-dnl NetBSD 3.0 . # . . . # # # # . ? # # # ? # . # . . . . . . # ? ?
-dnl Haiku . # . . # # # # # . # ? . . . . . ? . . ? . . . . # .
-dnl BeOS # # # . # # # # # . ? ? # . ? . # ? . . ? . . . ? ? ?
-dnl Android 4.3 . # . # # # # # # # # ? . # . # . # . . . # . . ? ? ?
-dnl old mingw / msvcrt # # # # # # # # # . . ? # # . # # ? . # # # . . # ? ?
-dnl MSVC 9 # # # # # # # # # # . ? # # . # # ? # # # # . . # ? ?
-dnl mingw 2009-2011 . # # . # . # # . . . ? # # . . . ? . . . . . . # ? ?
-dnl mingw-w64 2011 # # # # # # # # # . . ? # # . # # ? . # # # . . # ? ?
diff --git a/m4/signbit.m4 b/m4/signbit.m4
deleted file mode 100644
index 2fea73f854c..00000000000
--- a/m4/signbit.m4
+++ /dev/null
@@ -1,393 +0,0 @@
-# signbit.m4 serial 21
-dnl Copyright (C) 2007-2023 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.
-
-AC_DEFUN([gl_SIGNBIT],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST])
- AC_CACHE_CHECK([for signbit macro], [gl_cv_func_signbit],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <math.h>
-/* If signbit is defined as a function, don't use it, since calling it for
- 'float' or 'long double' arguments would involve conversions.
- If signbit is not declared at all but exists as a library function, don't
- use it, since the prototype may not match.
- If signbit is not declared at all but exists as a compiler built-in, don't
- use it, since it's preferable to use __builtin_signbit* (no warnings,
- no conversions). */
-#ifndef signbit
-# error "signbit should be a macro"
-#endif
-#include <string.h>
-]gl_SIGNBIT_TEST_PROGRAM
-])],
- [gl_cv_func_signbit=yes],
- [gl_cv_func_signbit=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_signbit="guessing yes" ;;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_signbit="guessing yes" ;;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_signbit="guessing yes" ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_signbit="$gl_cross_guess_normal" ;;
- esac
- ])
- ])
- dnl GCC >= 4.0 and clang provide three built-ins for signbit.
- dnl They can be used without warnings, also in C++, regardless of <math.h>.
- dnl But they may expand to calls to functions, which may or may not be in
- dnl libc.
- AC_CACHE_CHECK([for signbit compiler built-ins],
- [gl_cv_func_signbit_builtins],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
-# define signbit(x) \
- (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
- sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
- __builtin_signbitf (x))
-#else
-# error "signbit should be three compiler built-ins"
-#endif
-#include <string.h>
-]gl_SIGNBIT_TEST_PROGRAM
-])],
- [gl_cv_func_signbit_builtins=yes],
- [gl_cv_func_signbit_builtins=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_signbit_builtins="guessing yes" ;;
- # Guess yes on musl systems.
- *-musl* | midipix*) gl_cv_func_signbit_builtins="guessing yes" ;;
- # Guess yes on mingw, no on MSVC.
- mingw*) if test -n "$GCC"; then
- gl_cv_func_signbit_builtins="guessing yes"
- else
- gl_cv_func_signbit_builtins="guessing no"
- fi
- ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_signbit_builtins="$gl_cross_guess_normal" ;;
- esac
- ])
- ])
- dnl Use the compiler built-ins whenever possible, because they are more
- dnl efficient than the system library functions (if they exist).
- case "$gl_cv_func_signbit_builtins" in
- *yes)
- REPLACE_SIGNBIT_USING_BUILTINS=1
- ;;
- *)
- case "$gl_cv_func_signbit" in
- *yes) ;;
- *)
- dnl REPLACE_SIGNBIT=1 makes sure the signbit[fdl] functions get built.
- REPLACE_SIGNBIT=1
- ;;
- esac
- ;;
- esac
- dnl On Solaris 10, with CC in C++ mode, signbit is not available although
- dnl is with cc in C mode. This cannot be worked around by defining
- dnl _XOPEN_SOURCE=600, because the latter does not work in C++ mode on
- dnl Solaris 11.0. Therefore use the replacement functions on Solaris.
- case "$host_os" in
- solaris*)
- REPLACE_SIGNBIT=1
- ;;
- esac
- if test $REPLACE_SIGNBIT = 1; then
- gl_FLOAT_SIGN_LOCATION
- gl_DOUBLE_SIGN_LOCATION
- gl_LONG_DOUBLE_SIGN_LOCATION
- if test "$gl_cv_cc_float_signbit" = unknown; then
- dnl Test whether copysignf() is declared.
- AC_CHECK_DECLS([copysignf], , , [[#include <math.h>]])
- if test "$ac_cv_have_decl_copysignf" = yes; then
- dnl Test whether copysignf() can be used without libm.
- AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
- [gl_cv_func_copysignf_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- float x, y;]],
- [[return copysignf (x, y) < 0;]])],
- [gl_cv_func_copysignf_no_libm=yes],
- [gl_cv_func_copysignf_no_libm=no])
- ])
- if test $gl_cv_func_copysignf_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
- [Define if the copysignf function is declared in <math.h> and available in libc.])
- fi
- fi
- fi
- if test "$gl_cv_cc_double_signbit" = unknown; then
- dnl Test whether copysign() is declared.
- AC_CHECK_DECLS([copysign], , , [[#include <math.h>]])
- if test "$ac_cv_have_decl_copysign" = yes; then
- dnl Test whether copysign() can be used without libm.
- AC_CACHE_CHECK([whether copysign can be used without linking with libm],
- [gl_cv_func_copysign_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- double x, y;]],
- [[return copysign (x, y) < 0;]])],
- [gl_cv_func_copysign_no_libm=yes],
- [gl_cv_func_copysign_no_libm=no])
- ])
- if test $gl_cv_func_copysign_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
- [Define if the copysign function is declared in <math.h> and available in libc.])
- fi
- fi
- fi
- if test "$gl_cv_cc_long_double_signbit" = unknown; then
- dnl Test whether copysignl() is declared.
- AC_CHECK_DECLS([copysignl], , , [[#include <math.h>]])
- if test "$ac_cv_have_decl_copysignl" = yes; then
- dnl Test whether copysignl() can be used without libm.
- AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
- [gl_cv_func_copysignl_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x, y;]],
- [[return copysignl (x, y) < 0;]])],
- [gl_cv_func_copysignl_no_libm=yes],
- [gl_cv_func_copysignl_no_libm=no])
- ])
- if test $gl_cv_func_copysignl_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
- [Define if the copysignl function is declared in <math.h> and available in libc.])
- fi
- fi
- fi
- fi
-])
-
-AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[
-/* Global variables.
- Needed because GCC 4 constant-folds __builtin_signbitl (literal)
- but cannot constant-fold __builtin_signbitl (variable). */
-float vf;
-double vd;
-long double vl;
-int main ()
-{
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
- So we use -p0f and -p0d instead. */
-float p0f = 0.0f;
-float m0f = -p0f;
-double p0d = 0.0;
-double m0d = -p0d;
-/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use another constant expression instead.
- But that expression does not work on other platforms, such as when
- cross-compiling to PowerPC on Mac OS X 10.5. */
-long double p0l = 0.0L;
-#if defined __hpux || defined __sgi
-long double m0l = -LDBL_MIN * LDBL_MIN;
-#else
-long double m0l = -p0l;
-#endif
- int result = 0;
- if (signbit (vf)) /* link check */
- vf++;
- {
- float plus_inf = 1.0f / p0f;
- float minus_inf = -1.0f / p0f;
- if (!(!signbit (255.0f)
- && signbit (-255.0f)
- && !signbit (p0f)
- && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
- && !signbit (plus_inf)
- && signbit (minus_inf)))
- result |= 1;
- }
- if (signbit (vd)) /* link check */
- vd++;
- {
- double plus_inf = 1.0 / p0d;
- double minus_inf = -1.0 / p0d;
- if (!(!signbit (255.0)
- && signbit (-255.0)
- && !signbit (p0d)
- && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
- && !signbit (plus_inf)
- && signbit (minus_inf)))
- result |= 2;
- }
- if (signbit (vl)) /* link check */
- vl++;
- {
- long double plus_inf = 1.0L / p0l;
- long double minus_inf = -1.0L / p0l;
- if (signbit (255.0L))
- result |= 4;
- if (!signbit (-255.0L))
- result |= 4;
- if (signbit (p0l))
- result |= 8;
- if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)))
- result |= 16;
- if (signbit (plus_inf))
- result |= 32;
- if (!signbit (minus_inf))
- result |= 64;
- }
- return result;
-}
-]])
-
-AC_DEFUN([gl_FLOAT_SIGN_LOCATION],
-[
- gl_FLOATTYPE_SIGN_LOCATION([float], [gl_cv_cc_float_signbit], [f], [FLT])
-])
-
-AC_DEFUN([gl_DOUBLE_SIGN_LOCATION],
-[
- gl_FLOATTYPE_SIGN_LOCATION([double], [gl_cv_cc_double_signbit], [], [DBL])
-])
-
-AC_DEFUN([gl_LONG_DOUBLE_SIGN_LOCATION],
-[
- gl_FLOATTYPE_SIGN_LOCATION([long double], [gl_cv_cc_long_double_signbit], [L], [LDBL])
-])
-
-AC_DEFUN([gl_FLOATTYPE_SIGN_LOCATION],
-[
- AC_CACHE_CHECK([where to find the sign bit in a '$1'],
- [$2],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stddef.h>
-#include <stdio.h>
-#define NWORDS \
- ((sizeof ($1) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { $1 value; unsigned int word[NWORDS]; }
- memory_float;
-static memory_float plus = { 1.0$3 };
-static memory_float minus = { -1.0$3 };
-int main ()
-{
- size_t j, k, i;
- unsigned int m;
- FILE *fp = fopen ("conftest.out", "w");
- if (fp == NULL)
- return 1;
- /* Find the different bit. */
- k = 0; m = 0;
- for (j = 0; j < NWORDS; j++)
- {
- unsigned int x = plus.word[j] ^ minus.word[j];
- if ((x & (x - 1)) || (x && m))
- {
- /* More than one bit difference. */
- fprintf (fp, "unknown");
- fclose (fp);
- return 2;
- }
- if (x)
- {
- k = j;
- m = x;
- }
- }
- if (m == 0)
- {
- /* No difference. */
- fprintf (fp, "unknown");
- fclose (fp);
- return 3;
- }
- /* Now m = plus.word[k] ^ ~minus.word[k]. */
- if (plus.word[k] & ~minus.word[k])
- {
- /* Oh? The sign bit is set in the positive and cleared in the negative
- numbers? */
- fprintf (fp, "unknown");
- fclose (fp);
- return 4;
- }
- for (i = 0; ; i++)
- if ((m >> i) & 1)
- break;
- fprintf (fp, "word %d bit %d", (int) k, (int) i);
- if (fclose (fp) != 0)
- return 5;
- return 0;
-}
- ]])],
- [$2=`cat conftest.out`],
- [$2="unknown"],
- [
- dnl When cross-compiling, we don't know. It depends on the
- dnl ABI and compiler version. There are too many cases.
- $2="unknown"
- ])
- rm -f conftest.out
- ])
- case "$]$2[" in
- word*bit*)
- word=`echo "$]$2[" | sed -e 's/word //' -e 's/ bit.*//'`
- bit=`echo "$]$2[" | sed -e 's/word.*bit //'`
- AC_DEFINE_UNQUOTED([$4][_SIGNBIT_WORD], [$word],
- [Define as the word index where to find the sign of '$1'.])
- AC_DEFINE_UNQUOTED([$4][_SIGNBIT_BIT], [$bit],
- [Define as the bit index in the word where to find the sign of '$1'.])
- ;;
- esac
-])
-
-# Expands to code that defines a function signbitf(float).
-# It extracts the sign bit of a non-NaN value.
-AC_DEFUN([gl_FLOAT_SIGNBIT_CODE],
-[
- gl_FLOATTYPE_SIGNBIT_CODE([float], [f], [f])
-])
-
-# Expands to code that defines a function signbitd(double).
-# It extracts the sign bit of a non-NaN value.
-AC_DEFUN([gl_DOUBLE_SIGNBIT_CODE],
-[
- gl_FLOATTYPE_SIGNBIT_CODE([double], [d], [])
-])
-
-# Expands to code that defines a function signbitl(long double).
-# It extracts the sign bit of a non-NaN value.
-AC_DEFUN([gl_LONG_DOUBLE_SIGNBIT_CODE],
-[
- gl_FLOATTYPE_SIGNBIT_CODE([long double], [l], [L])
-])
-
-AC_DEFUN([gl_FLOATTYPE_SIGNBIT_CODE],
-[[
-static int
-signbit$2 ($1 value)
-{
- typedef union { $1 f; unsigned char b[sizeof ($1)]; } float_union;
- static float_union plus_one = { 1.0$3 }; /* unused bits are zero here */
- static float_union minus_one = { -1.0$3 }; /* unused bits are zero here */
- /* Compute the sign bit mask as the XOR of plus_one and minus_one. */
- float_union u;
- unsigned int i;
- u.f = value;
- for (i = 0; i < sizeof ($1); i++)
- if (u.b[i] & (plus_one.b[i] ^ minus_one.b[i]))
- return 1;
- return 0;
-}
-]])
diff --git a/m4/size_max.m4 b/m4/size_max.m4
deleted file mode 100644
index 0763366dfc3..00000000000
--- a/m4/size_max.m4
+++ /dev/null
@@ -1,75 +0,0 @@
-# size_max.m4 serial 12
-dnl Copyright (C) 2003, 2005-2006, 2008-2023 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 From Bruno Haible.
-
-AC_PREREQ([2.61])
-
-AC_DEFUN([gl_SIZE_MAX],
-[
- AC_CHECK_HEADERS([stdint.h])
- dnl First test whether the system already has SIZE_MAX.
- AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
- gl_cv_size_max=no
- AC_EGREP_CPP([Found it], [
-#include <limits.h>
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifdef SIZE_MAX
-Found it
-#endif
-], [gl_cv_size_max=yes])
- if test $gl_cv_size_max != yes; then
- dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
- dnl than the type 'unsigned long'. Try hard to find a definition that can
- dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
- AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
- [#include <stddef.h>
-#include <limits.h>], [size_t_bits_minus_1=])
- AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
- [#include <stddef.h>], [fits_in_uint=])
- if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
- if test $fits_in_uint = 1; then
- dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
- dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <stddef.h>
- extern size_t foo;
- extern unsigned long foo;
- ]],
- [[]])],
- [fits_in_uint=0])
- fi
- dnl We cannot use 'expr' to simplify this expression, because 'expr'
- dnl works only with 'long' integers in the host environment, while we
- dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
- if test $fits_in_uint = 1; then
- gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
- else
- gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
- fi
- else
- dnl Shouldn't happen, but who knows...
- gl_cv_size_max='((size_t)~(size_t)0)'
- fi
- fi
- ])
- if test "$gl_cv_size_max" != yes; then
- AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
- [Define as the maximum value of type 'size_t', if the system doesn't define it.])
- fi
- dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
- dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
- dnl #define by AC_DEFINE_UNQUOTED.
- AH_VERBATIM([SIZE_MAX],
-[/* Define as the maximum value of type 'size_t', if the system doesn't define
- it. */
-#ifndef SIZE_MAX
-# undef SIZE_MAX
-#endif])
-])
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
deleted file mode 100644
index 70349f6cb21..00000000000
--- a/m4/stdint_h.m4
+++ /dev/null
@@ -1,27 +0,0 @@
-# stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2023 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 From Paul Eggert.
-
-# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
-# doesn't clash with <sys/types.h>, and declares uintmax_t.
-
-AC_DEFUN([gl_AC_HEADER_STDINT_H],
-[
- AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <sys/types.h>
- #include <stdint.h>]],
- [[uintmax_t i = (uintmax_t) -1; return !i;]])],
- [gl_cv_header_stdint_h=yes],
- [gl_cv_header_stdint_h=no])])
- if test $gl_cv_header_stdint_h = yes; then
- AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
- [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
- and declares uintmax_t. ])
- fi
-])
diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4
deleted file mode 100644
index df87b9e7986..00000000000
--- a/m4/vasnprintf.m4
+++ /dev/null
@@ -1,462 +0,0 @@
-# vasnprintf.m4 serial 50
-dnl Copyright (C) 2002-2004, 2006-2023 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.
-
-AC_DEFUN([gl_FUNC_VASNPRINTF],
-[
- AC_CHECK_FUNCS_ONCE([vasnprintf])
- if test $ac_cv_func_vasnprintf = no; then
- gl_REPLACE_VASNPRINTF
- fi
-])
-
-AC_DEFUN([gl_REPLACE_VASNPRINTF],
-[
- AC_CHECK_FUNCS_ONCE([vasnprintf])
- AC_LIBOBJ([vasnprintf])
- AC_LIBOBJ([printf-args])
- AC_LIBOBJ([printf-parse])
- AC_LIBOBJ([asnprintf])
- if test $ac_cv_func_vasnprintf = yes; then
- AC_DEFINE([REPLACE_VASNPRINTF], [1],
- [Define if vasnprintf exists but is overridden by gnulib.])
- fi
- gl_PREREQ_PRINTF_ARGS
- gl_PREREQ_PRINTF_PARSE
- gl_PREREQ_VASNPRINTF
- gl_PREREQ_ASNPRINTF
-])
-
-AC_DEFUN([gl_FUNC_VASNWPRINTF],
-[
- AC_LIBOBJ([printf-args])
- gl_PREREQ_PRINTF_ARGS
- gl_PREREQ_PRINTF_PARSE
- gl_PREREQ_VASNWPRINTF
- gl_PREREQ_ASNPRINTF
-])
-
-# Prerequisites of lib/printf-args.h, lib/printf-args.c.
-AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
-[
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
-])
-
-# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
-# Prerequisites of lib/wprintf-parse.h, lib/wprintf-parse.c.
-AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
-[
- AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
- AC_REQUIRE([AC_TYPE_SIZE_T])
- AC_CHECK_TYPE([ptrdiff_t], ,
- [AC_DEFINE([ptrdiff_t], [long],
- [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
- ])
- AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
-])
-
-# Prerequisites of lib/vasnprintf.c if !WIDE_CHAR_VERSION.
-AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
-[
- AC_CHECK_FUNCS([snprintf strnlen wcrtomb])
- dnl Use the _snprintf function only if it is declared (because on NetBSD it
- dnl is defined as a weak alias of snprintf; we prefer to use the latter).
- AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]])
- dnl We can avoid a lot of code by assuming that snprintf's return value
- dnl conforms to ISO C99. So check that.
- AC_REQUIRE([gl_SNPRINTF_RETVAL_C99])
- case "$gl_cv_func_snprintf_retval_c99" in
- *yes)
- AC_DEFINE([HAVE_SNPRINTF_RETVAL_C99], [1],
- [Define if the return value of the snprintf function is the number of
- of bytes (excluding the terminating NUL) that would have been produced
- if the buffer had been large enough.])
- ;;
- esac
- dnl Additionally, the use of %n can be eliminated by assuming that snprintf
- dnl always produces NUL-terminated strings (no truncation).
- AC_REQUIRE([gl_SNPRINTF_TRUNCATION_C99])
- case "$gl_cv_func_snprintf_truncation_c99" in
- *yes)
- AC_DEFINE([HAVE_SNPRINTF_TRUNCATION_C99], [1],
- [Define if the string produced by the snprintf function is always NUL
- terminated.])
- ;;
- esac
- gl_PREREQ_VASNXPRINTF
-])
-
-# Prerequisites of lib/vasnwprintf.c.
-AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF],
-[
- AC_CHECK_FUNCS_ONCE([swprintf wcsnlen mbrtowc])
- AC_CHECK_DECLS([_snwprintf], , , [[#include <stdio.h>]])
- AC_CHECK_DECLS([wcsnlen], , , [[#include <wchar.h>]])
- gl_SWPRINTF_WORKS
- case "$gl_cv_func_swprintf_works" in
- *yes)
- AC_DEFINE([HAVE_WORKING_SWPRINTF], [1],
- [Define if the swprintf function works correctly when it produces output
- that contains null wide characters.])
- ;;
- esac
- gl_MBRTOWC_C_LOCALE
- case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
- *yes)
- AC_CACHE_CHECK([whether swprintf in the C locale is free of encoding errors],
- [gl_cv_func_swprintf_C_locale_sans_EILSEQ],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#ifndef __USE_MINGW_ANSI_STDIO
-# define __USE_MINGW_ANSI_STDIO 1
-#endif
-#include <stdio.h>
-#include <wchar.h>
-int main()
-{
- int result = 0;
- { /* This test fails on glibc 2.35, musl libc 1.2.4, FreeBSD 13.2, NetBSD 9.3,
- OpenBSD 7.2, Cygwin 2.9.0.
- Reported at <https://www.openwall.com/lists/musl/2023/06/12/2>. */
- wchar_t buf[12];
- int ret = swprintf (buf, 12, L"%c", '\377');
- if (ret < 0)
- result |= 1;
- }
- return result;
-}]])],
- [gl_cv_func_swprintf_C_locale_sans_EILSEQ=yes],
- [gl_cv_func_swprintf_C_locale_sans_EILSEQ=no],
- [case "$host_os" in
- # Guess no on glibc systems.
- *-gnu* | gnu*) gl_cv_func_swprintf_C_locale_sans_EILSEQ="guessing yes";;
- # Guess no on musl systems.
- *-musl* | midipix*) gl_cv_func_swprintf_C_locale_sans_EILSEQ="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_swprintf_C_locale_sans_EILSEQ="$gl_cross_guess_normal";;
- esac
- ])
- ])
- ;;
- esac
- if case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
- *yes) false ;;
- *) true ;;
- esac \
- || case "$gl_cv_func_swprintf_C_locale_sans_EILSEQ" in
- *yes) false ;;
- *) true ;;
- esac; then
- AC_DEFINE([NEED_WPRINTF_DIRECTIVE_C], [1],
- [Define if the vasnwprintf implementation needs special code for
- the 'c' directive.])
- fi
- gl_SWPRINTF_DIRECTIVE_LA
- case "$gl_cv_func_swprintf_directive_la" in
- *yes) ;;
- *)
- AC_DEFINE([NEED_WPRINTF_DIRECTIVE_LA], [1],
- [Define if the vasnwprintf implementation needs special code for
- the 'a' directive with 'long double' arguments.])
- ;;
- esac
- gl_SWPRINTF_DIRECTIVE_LC
- case "$gl_cv_func_swprintf_directive_lc" in
- *yes) ;;
- *)
- AC_DEFINE([NEED_WPRINTF_DIRECTIVE_LC], [1],
- [Define if the vasnwprintf implementation needs special code for
- the 'lc' directive.])
- ;;
- esac
- gl_MUSL_LIBC
- gl_PREREQ_VASNXPRINTF
-])
-
-# Common prerequisites of lib/vasnprintf.c and lib/vasnwprintf.c.
-AC_DEFUN_ONCE([gl_PREREQ_VASNXPRINTF],
-[
- AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
- AC_CHECK_FUNCS([wcslen])
- dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
- dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE.
- AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
-# arguments.
-AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
-[
- AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
- case "$gl_cv_func_printf_long_double" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
- [Define if the vasnprintf implementation needs special code for
- 'long double' arguments.])
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double'
-# arguments.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE],
-[
- AC_REQUIRE([gl_PRINTF_INFINITE])
- case "$gl_cv_func_printf_infinite" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1],
- [Define if the vasnprintf implementation needs special code for
- infinite 'double' arguments.])
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double'
-# arguments.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE],
-[
- AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
- dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if
- dnl NEED_PRINTF_LONG_DOUBLE is already set.
- AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE])
- case "$gl_cv_func_printf_long_double" in
- *yes)
- case "$gl_cv_func_printf_infinite_long_double" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1],
- [Define if the vasnprintf implementation needs special code for
- infinite 'long double' arguments.])
- ;;
- esac
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A],
-[
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
- case "$gl_cv_func_printf_directive_a" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1],
- [Define if the vasnprintf implementation needs special code for
- the 'a' and 'A' directives.])
- gl_CHECK_FUNCS_ANDROID([nl_langinfo], [[#include <langinfo.h>]])
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting the 'b' directive.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_B],
-[
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_B])
- case "$gl_cv_func_printf_directive_b" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_DIRECTIVE_B], [1],
- [Define if the vasnprintf implementation needs special code for
- the 'b' directive.])
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F],
-[
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
- case "$gl_cv_func_printf_directive_f" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1],
- [Define if the vasnprintf implementation needs special code for
- the 'F' directive.])
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting the 'ls' directive.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS],
-[
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS])
- case "$gl_cv_func_printf_directive_ls" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_DIRECTIVE_LS], [1],
- [Define if the vasnprintf implementation needs special code for
- the 'ls' directive.])
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting the 'lc' directive.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LC],
-[
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_LC])
- case "$gl_cv_func_printf_directive_lc" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_DIRECTIVE_LC], [1],
- [Define if the vasnprintf implementation needs special code for
- the 'lc' directive.])
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
-[
- AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
- case "$gl_cv_func_printf_flag_grouping" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1],
- [Define if the vasnprintf implementation needs special code for the
- ' flag.])
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST],
-[
- AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
- case "$gl_cv_func_printf_flag_leftadjust" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1],
- [Define if the vasnprintf implementation needs special code for the
- '-' flag.])
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
-[
- AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
- case "$gl_cv_func_printf_flag_zero" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1],
- [Define if the vasnprintf implementation needs special code for the
- 0 flag.])
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting large precisions.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION],
-[
- AC_REQUIRE([gl_PRINTF_PRECISION])
- case "$gl_cv_func_printf_precision" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1],
- [Define if the vasnprintf implementation needs special code for
- supporting large precisions without arbitrary bounds.])
- AC_DEFINE([NEED_PRINTF_DOUBLE], [1],
- [Define if the vasnprintf implementation needs special code for
- 'double' arguments.])
- AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
- [Define if the vasnprintf implementation needs special code for
- 'long double' arguments.])
- ;;
- esac
-])
-
-# Extra prerequisites of lib/vasnprintf.c for surviving out-of-memory
-# conditions.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM],
-[
- AC_REQUIRE([gl_PRINTF_ENOMEM])
- case "$gl_cv_func_printf_enomem" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_ENOMEM], [1],
- [Define if the vasnprintf implementation needs special code for
- surviving out-of-memory conditions.])
- AC_DEFINE([NEED_PRINTF_DOUBLE], [1],
- [Define if the vasnprintf implementation needs special code for
- 'double' arguments.])
- AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
- [Define if the vasnprintf implementation needs special code for
- 'long double' arguments.])
- ;;
- esac
-])
-
-# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS],
-[
- AC_REQUIRE([gl_PREREQ_VASNPRINTF])
- gl_PREREQ_VASNPRINTF_LONG_DOUBLE
- gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
- gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
- gl_PREREQ_VASNPRINTF_DIRECTIVE_A
- gl_PREREQ_VASNPRINTF_DIRECTIVE_B
- gl_PREREQ_VASNPRINTF_DIRECTIVE_F
- gl_PREREQ_VASNPRINTF_DIRECTIVE_LS
- gl_PREREQ_VASNPRINTF_DIRECTIVE_LC
- gl_PREREQ_VASNPRINTF_FLAG_GROUPING
- gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
- gl_PREREQ_VASNPRINTF_FLAG_ZERO
- gl_PREREQ_VASNPRINTF_PRECISION
- gl_PREREQ_VASNPRINTF_ENOMEM
-])
-
-# Extra prerequisites of lib/vasnprintf.c for supporting the 'B' directive.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B],
-[
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_UPPERCASE_B])
- case "$gl_cv_func_printf_directive_uppercase_b" in
- *yes)
- ;;
- *)
- AC_DEFINE([NEED_PRINTF_DIRECTIVE_UPPERCASE_B], [1],
- [Define if the vasnprintf implementation needs special code for
- the 'B' directive.])
- ;;
- esac
-])
-
-# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance
-# and GNU compatibility.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS],
-[
- gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
- AC_DEFINE([SUPPORT_GNU_PRINTF_DIRECTIVES], [1],
- [Define if the vasnprintf implementation should support GNU compatible
- printf directives.])
- gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B
-])
-
-# Prerequisites of lib/asnprintf.c.
-# Prerequisites of lib/asnwprintf.c.
-AC_DEFUN([gl_PREREQ_ASNPRINTF],
-[
-])
diff --git a/m4/vasprintf-posix.m4 b/m4/vasprintf-posix.m4
deleted file mode 100644
index 3c7a6540bd1..00000000000
--- a/m4/vasprintf-posix.m4
+++ /dev/null
@@ -1,113 +0,0 @@
-# vasprintf-posix.m4 serial 17
-dnl Copyright (C) 2007-2023 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.
-
-AC_DEFUN([gl_FUNC_VASPRINTF_POSIX],
-[
- AC_REQUIRE([gl_FUNC_VASPRINTF_IS_POSIX])
- if test $gl_cv_func_vasprintf_posix = no; then
- gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
- gl_REPLACE_VASNPRINTF
- gl_REPLACE_VASPRINTF
- fi
-])
-
-dnl Test whether vasprintf exists and is POSIX compliant.
-dnl Result is gl_cv_func_vasprintf_posix.
-AC_DEFUN([gl_FUNC_VASPRINTF_IS_POSIX],
-[
- AC_REQUIRE([gl_PRINTF_SIZES_C99])
- AC_REQUIRE([gl_PRINTF_SIZES_C23])
- AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
- AC_REQUIRE([gl_PRINTF_INFINITE])
- AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_B])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_N])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_LC])
- AC_REQUIRE([gl_PRINTF_POSITIONS])
- AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
- AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
- AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
- AC_REQUIRE([gl_PRINTF_PRECISION])
- AC_REQUIRE([gl_PRINTF_ENOMEM])
- gl_cv_func_vasprintf_posix=no
- AC_CHECK_FUNCS([vasprintf])
- case "$gl_cv_func_printf_sizes_c99" in
- *yes)
- case "$gl_cv_func_printf_sizes_c23" in
- *yes)
- case "$gl_cv_func_printf_long_double" in
- *yes)
- case "$gl_cv_func_printf_infinite" in
- *yes)
- case "$gl_cv_func_printf_infinite_long_double" in
- *yes)
- case "$gl_cv_func_printf_directive_a" in
- *yes)
- case "$gl_cv_func_printf_directive_b" in
- *yes)
- case "$gl_cv_func_printf_directive_f" in
- *yes)
- case "$gl_cv_func_printf_directive_n" in
- *yes)
- case "$gl_cv_func_printf_directive_ls" in
- *yes)
- case "$gl_cv_func_printf_directive_lc" in
- *yes)
- case "$gl_cv_func_printf_positions" in
- *yes)
- case "$gl_cv_func_printf_flag_grouping" in
- *yes)
- case "$gl_cv_func_printf_flag_leftadjust" in
- *yes)
- case "$gl_cv_func_printf_flag_zero" in
- *yes)
- case "$gl_cv_func_printf_precision" in
- *yes)
- case "$gl_cv_func_printf_enomem" in
- *yes)
- if test $ac_cv_func_vasprintf = yes; then
- # vasprintf exists and is
- # already POSIX compliant.
- gl_cv_func_vasprintf_posix=yes
- fi
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
-])
diff --git a/m4/vasprintf.m4 b/m4/vasprintf.m4
deleted file mode 100644
index 6e6156a7549..00000000000
--- a/m4/vasprintf.m4
+++ /dev/null
@@ -1,46 +0,0 @@
-# vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2023 Free Software Foundation,
-dnl 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.
-
-AC_DEFUN([gl_FUNC_VASPRINTF],
-[
- AC_CHECK_FUNCS([vasprintf])
- if test $ac_cv_func_vasprintf = no; then
- gl_REPLACE_VASPRINTF
- fi
-])
-
-AC_DEFUN([gl_REPLACE_VASPRINTF],
-[
- AC_LIBOBJ([vasprintf])
- AC_LIBOBJ([asprintf])
- AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- if test $ac_cv_func_vasprintf = yes; then
- REPLACE_VASPRINTF=1
- else
- HAVE_VASPRINTF=0
- fi
- gl_PREREQ_VASPRINTF_H
- gl_PREREQ_VASPRINTF
- gl_PREREQ_ASPRINTF
-])
-
-# Prerequisites of the vasprintf portion of lib/stdio.h.
-AC_DEFUN([gl_PREREQ_VASPRINTF_H],
-[
- dnl Persuade glibc <stdio.h> to declare asprintf() and vasprintf().
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-])
-
-# Prerequisites of lib/vasprintf.c.
-AC_DEFUN([gl_PREREQ_VASPRINTF],
-[
-])
-
-# Prerequisites of lib/asprintf.c.
-AC_DEFUN([gl_PREREQ_ASPRINTF],
-[
-])
diff --git a/m4/vfprintf-posix.m4 b/m4/vfprintf-posix.m4
deleted file mode 100644
index 6b51c50adab..00000000000
--- a/m4/vfprintf-posix.m4
+++ /dev/null
@@ -1,122 +0,0 @@
-# vfprintf-posix.m4 serial 18
-dnl Copyright (C) 2007-2023 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.
-
-AC_DEFUN([gl_FUNC_VFPRINTF_POSIX],
-[
- AC_REQUIRE([gl_FUNC_VFPRINTF_IS_POSIX])
- if test $gl_cv_func_vfprintf_posix = no; then
- gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
- gl_REPLACE_VASNPRINTF
- gl_REPLACE_VFPRINTF
- fi
-])
-
-dnl Test whether vfprintf is POSIX compliant.
-dnl Result is gl_cv_func_vfprintf_posix.
-AC_DEFUN([gl_FUNC_VFPRINTF_IS_POSIX],
-[
- AC_REQUIRE([gl_PRINTF_SIZES_C99])
- AC_REQUIRE([gl_PRINTF_SIZES_C23])
- AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
- AC_REQUIRE([gl_PRINTF_INFINITE])
- AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_B])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_N])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_LC])
- AC_REQUIRE([gl_PRINTF_POSITIONS])
- AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
- AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
- AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
- AC_REQUIRE([gl_PRINTF_PRECISION])
- AC_REQUIRE([gl_PRINTF_ENOMEM])
- gl_cv_func_vfprintf_posix=no
- case "$gl_cv_func_printf_sizes_c99" in
- *yes)
- case "$gl_cv_func_printf_sizes_c23" in
- *yes)
- case "$gl_cv_func_printf_long_double" in
- *yes)
- case "$gl_cv_func_printf_infinite" in
- *yes)
- case "$gl_cv_func_printf_infinite_long_double" in
- *yes)
- case "$gl_cv_func_printf_directive_a" in
- *yes)
- case "$gl_cv_func_printf_directive_b" in
- *yes)
- case "$gl_cv_func_printf_directive_f" in
- *yes)
- case "$gl_cv_func_printf_directive_n" in
- *yes)
- case "$gl_cv_func_printf_directive_ls" in
- *yes)
- case "$gl_cv_func_printf_directive_lc" in
- *yes)
- case "$gl_cv_func_printf_positions" in
- *yes)
- case "$gl_cv_func_printf_flag_grouping" in
- *yes)
- case "$gl_cv_func_printf_flag_leftadjust" in
- *yes)
- case "$gl_cv_func_printf_flag_zero" in
- *yes)
- case "$gl_cv_func_printf_precision" in
- *yes)
- case "$gl_cv_func_printf_enomem" in
- *yes)
- # vfprintf exists and is
- # already POSIX compliant.
- gl_cv_func_vfprintf_posix=yes
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
-])
-
-AC_DEFUN([gl_REPLACE_VFPRINTF],
-[
- AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_LIBOBJ([vfprintf])
- REPLACE_VFPRINTF=1
- AC_DEFINE([REPLACE_VFPRINTF_POSIX], [1],
- [Define if vfprintf is overridden by a POSIX compliant gnulib implementation.])
- gl_PREREQ_VFPRINTF
-])
-
-AC_DEFUN([gl_PREREQ_VFPRINTF], [:])
diff --git a/m4/xsize.m4 b/m4/xsize.m4
deleted file mode 100644
index 649db9c5eab..00000000000
--- a/m4/xsize.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-# xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2023 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.
-
-AC_DEFUN([gl_XSIZE],
-[
- dnl Prerequisites of lib/xsize.h.
- AC_REQUIRE([gl_SIZE_MAX])
- AC_CHECK_HEADERS([stdint.h])
-])