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.
This commit is contained in:
parent
072a8a434e
commit
76cac8ae6f
72 changed files with 58 additions and 19990 deletions
|
@ -1,3 +1,13 @@
|
|||
2023-08-07 Po Lu <luangruo@yahoo.com>
|
||||
|
||||
* 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.
|
||||
|
||||
2023-08-06 Po Lu <luangruo@yahoo.com>
|
||||
|
||||
* java/org/gnu/emacs/EmacsService.java (readDirectoryEntry): Fix
|
||||
|
|
|
@ -42,7 +42,7 @@ GNULIB_MODULES='
|
|||
manywarnings memmem-simple mempcpy memrchr memset_explicit
|
||||
minmax mkostemp mktime
|
||||
nanosleep nproc nstrftime
|
||||
pathmax pipe2 printf-posix vasprintf-posix pselect pthread_sigmask
|
||||
pathmax pipe2 pselect pthread_sigmask
|
||||
qcopy-acl readlink readlinkat regex
|
||||
sig2str sigdescr_np socklen stat-time std-gnu11 stdbool stdckdint stddef stdio
|
||||
stpcpy stpncpy strnlen strnlen strtoimax symlink sys_stat sys_time
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
/* Formatted output to strings.
|
||||
Copyright (C) 1999, 2002, 2006, 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "vasnprintf.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
char *
|
||||
asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
char *result;
|
||||
|
||||
va_start (args, format);
|
||||
result = vasnprintf (resultbuf, lengthp, format, args);
|
||||
va_end (args);
|
||||
return result;
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
/* Formatted output to strings.
|
||||
Copyright (C) 1999, 2002, 2006-2007, 2009-2023 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#ifdef IN_LIBASPRINTF
|
||||
# include "vasprintf.h"
|
||||
#else
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
int
|
||||
asprintf (char **resultp, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int result;
|
||||
|
||||
va_start (args, format);
|
||||
result = vasprintf (resultp, format, args);
|
||||
va_end (args);
|
||||
return result;
|
||||
}
|
147
lib/float+.h
147
lib/float+.h
|
@ -1,147 +0,0 @@
|
|||
/* Supplemental information about the floating-point formats.
|
||||
Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2007.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FLOATPLUS_H
|
||||
#define _FLOATPLUS_H
|
||||
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
|
||||
/* Number of bits in the mantissa of a floating-point number, including the
|
||||
"hidden bit". */
|
||||
#if FLT_RADIX == 2
|
||||
# define FLT_MANT_BIT FLT_MANT_DIG
|
||||
# define DBL_MANT_BIT DBL_MANT_DIG
|
||||
# define LDBL_MANT_BIT LDBL_MANT_DIG
|
||||
#elif FLT_RADIX == 4
|
||||
# define FLT_MANT_BIT (FLT_MANT_DIG * 2)
|
||||
# define DBL_MANT_BIT (DBL_MANT_DIG * 2)
|
||||
# define LDBL_MANT_BIT (LDBL_MANT_DIG * 2)
|
||||
#elif FLT_RADIX == 16
|
||||
# define FLT_MANT_BIT (FLT_MANT_DIG * 4)
|
||||
# define DBL_MANT_BIT (DBL_MANT_DIG * 4)
|
||||
# define LDBL_MANT_BIT (LDBL_MANT_DIG * 4)
|
||||
#endif
|
||||
|
||||
/* Bit mask that can be used to mask the exponent, as an unsigned number. */
|
||||
#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7)
|
||||
#define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
|
||||
#define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7)
|
||||
|
||||
/* Number of bits used for the exponent of a floating-point number, including
|
||||
the exponent's sign. */
|
||||
#define FLT_EXP_BIT \
|
||||
(FLT_EXP_MASK < 0x100 ? 8 : \
|
||||
FLT_EXP_MASK < 0x200 ? 9 : \
|
||||
FLT_EXP_MASK < 0x400 ? 10 : \
|
||||
FLT_EXP_MASK < 0x800 ? 11 : \
|
||||
FLT_EXP_MASK < 0x1000 ? 12 : \
|
||||
FLT_EXP_MASK < 0x2000 ? 13 : \
|
||||
FLT_EXP_MASK < 0x4000 ? 14 : \
|
||||
FLT_EXP_MASK < 0x8000 ? 15 : \
|
||||
FLT_EXP_MASK < 0x10000 ? 16 : \
|
||||
FLT_EXP_MASK < 0x20000 ? 17 : \
|
||||
FLT_EXP_MASK < 0x40000 ? 18 : \
|
||||
FLT_EXP_MASK < 0x80000 ? 19 : \
|
||||
FLT_EXP_MASK < 0x100000 ? 20 : \
|
||||
FLT_EXP_MASK < 0x200000 ? 21 : \
|
||||
FLT_EXP_MASK < 0x400000 ? 22 : \
|
||||
FLT_EXP_MASK < 0x800000 ? 23 : \
|
||||
FLT_EXP_MASK < 0x1000000 ? 24 : \
|
||||
FLT_EXP_MASK < 0x2000000 ? 25 : \
|
||||
FLT_EXP_MASK < 0x4000000 ? 26 : \
|
||||
FLT_EXP_MASK < 0x8000000 ? 27 : \
|
||||
FLT_EXP_MASK < 0x10000000 ? 28 : \
|
||||
FLT_EXP_MASK < 0x20000000 ? 29 : \
|
||||
FLT_EXP_MASK < 0x40000000 ? 30 : \
|
||||
FLT_EXP_MASK <= 0x7fffffff ? 31 : \
|
||||
32)
|
||||
#define DBL_EXP_BIT \
|
||||
(DBL_EXP_MASK < 0x100 ? 8 : \
|
||||
DBL_EXP_MASK < 0x200 ? 9 : \
|
||||
DBL_EXP_MASK < 0x400 ? 10 : \
|
||||
DBL_EXP_MASK < 0x800 ? 11 : \
|
||||
DBL_EXP_MASK < 0x1000 ? 12 : \
|
||||
DBL_EXP_MASK < 0x2000 ? 13 : \
|
||||
DBL_EXP_MASK < 0x4000 ? 14 : \
|
||||
DBL_EXP_MASK < 0x8000 ? 15 : \
|
||||
DBL_EXP_MASK < 0x10000 ? 16 : \
|
||||
DBL_EXP_MASK < 0x20000 ? 17 : \
|
||||
DBL_EXP_MASK < 0x40000 ? 18 : \
|
||||
DBL_EXP_MASK < 0x80000 ? 19 : \
|
||||
DBL_EXP_MASK < 0x100000 ? 20 : \
|
||||
DBL_EXP_MASK < 0x200000 ? 21 : \
|
||||
DBL_EXP_MASK < 0x400000 ? 22 : \
|
||||
DBL_EXP_MASK < 0x800000 ? 23 : \
|
||||
DBL_EXP_MASK < 0x1000000 ? 24 : \
|
||||
DBL_EXP_MASK < 0x2000000 ? 25 : \
|
||||
DBL_EXP_MASK < 0x4000000 ? 26 : \
|
||||
DBL_EXP_MASK < 0x8000000 ? 27 : \
|
||||
DBL_EXP_MASK < 0x10000000 ? 28 : \
|
||||
DBL_EXP_MASK < 0x20000000 ? 29 : \
|
||||
DBL_EXP_MASK < 0x40000000 ? 30 : \
|
||||
DBL_EXP_MASK <= 0x7fffffff ? 31 : \
|
||||
32)
|
||||
#define LDBL_EXP_BIT \
|
||||
(LDBL_EXP_MASK < 0x100 ? 8 : \
|
||||
LDBL_EXP_MASK < 0x200 ? 9 : \
|
||||
LDBL_EXP_MASK < 0x400 ? 10 : \
|
||||
LDBL_EXP_MASK < 0x800 ? 11 : \
|
||||
LDBL_EXP_MASK < 0x1000 ? 12 : \
|
||||
LDBL_EXP_MASK < 0x2000 ? 13 : \
|
||||
LDBL_EXP_MASK < 0x4000 ? 14 : \
|
||||
LDBL_EXP_MASK < 0x8000 ? 15 : \
|
||||
LDBL_EXP_MASK < 0x10000 ? 16 : \
|
||||
LDBL_EXP_MASK < 0x20000 ? 17 : \
|
||||
LDBL_EXP_MASK < 0x40000 ? 18 : \
|
||||
LDBL_EXP_MASK < 0x80000 ? 19 : \
|
||||
LDBL_EXP_MASK < 0x100000 ? 20 : \
|
||||
LDBL_EXP_MASK < 0x200000 ? 21 : \
|
||||
LDBL_EXP_MASK < 0x400000 ? 22 : \
|
||||
LDBL_EXP_MASK < 0x800000 ? 23 : \
|
||||
LDBL_EXP_MASK < 0x1000000 ? 24 : \
|
||||
LDBL_EXP_MASK < 0x2000000 ? 25 : \
|
||||
LDBL_EXP_MASK < 0x4000000 ? 26 : \
|
||||
LDBL_EXP_MASK < 0x8000000 ? 27 : \
|
||||
LDBL_EXP_MASK < 0x10000000 ? 28 : \
|
||||
LDBL_EXP_MASK < 0x20000000 ? 29 : \
|
||||
LDBL_EXP_MASK < 0x40000000 ? 30 : \
|
||||
LDBL_EXP_MASK <= 0x7fffffff ? 31 : \
|
||||
32)
|
||||
|
||||
/* Number of bits used for a floating-point number: the mantissa (not
|
||||
counting the "hidden bit", since it may or may not be explicit), the
|
||||
exponent, and the sign. */
|
||||
#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1)
|
||||
#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1)
|
||||
#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1)
|
||||
|
||||
/* Number of bytes used for a floating-point number.
|
||||
This can be smaller than the 'sizeof'. For example, on i386 systems,
|
||||
'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence
|
||||
LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but
|
||||
sizeof (long double) = 12 or = 16. */
|
||||
#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
|
||||
#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
|
||||
#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
|
||||
|
||||
/* Verify that SIZEOF_FLT <= sizeof (float) etc. */
|
||||
typedef int verify_sizeof_flt[SIZEOF_FLT <= sizeof (float) ? 1 : -1];
|
||||
typedef int verify_sizeof_dbl[SIZEOF_DBL <= sizeof (double) ? 1 : - 1];
|
||||
typedef int verify_sizeof_ldbl[SIZEOF_LDBL <= sizeof (long double) ? 1 : - 1];
|
||||
|
||||
#endif /* _FLOATPLUS_H */
|
33
lib/float.c
33
lib/float.c
|
@ -1,33 +0,0 @@
|
|||
/* Auxiliary definitions for <float.h>.
|
||||
Copyright (C) 2011-2023 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2011.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <float.h>
|
||||
|
||||
#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
|
||||
const union gl_long_double_union gl_LDBL_MAX =
|
||||
{ { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
|
||||
#elif defined __i386__
|
||||
const union gl_long_double_union gl_LDBL_MAX =
|
||||
{ { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
|
||||
#else
|
||||
/* This declaration is solely to ensure that after preprocessing
|
||||
this file is never empty. */
|
||||
typedef int dummy;
|
||||
#endif
|
194
lib/float.in.h
194
lib/float.in.h
|
@ -1,194 +0,0 @@
|
|||
/* A correct <float.h>.
|
||||
|
||||
Copyright (C) 2007-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_FLOAT_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT@ @NEXT_FLOAT_H@
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_FLOAT_H
|
||||
#define _@GUARD_PREFIX@_FLOAT_H
|
||||
|
||||
/* 'long double' properties. */
|
||||
|
||||
#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
|
||||
/* Number of mantissa units, in base FLT_RADIX. */
|
||||
# undef LDBL_MANT_DIG
|
||||
# define LDBL_MANT_DIG 64
|
||||
/* Number of decimal digits that is sufficient for representing a number. */
|
||||
# undef LDBL_DIG
|
||||
# define LDBL_DIG 18
|
||||
/* x-1 where x is the smallest representable number > 1. */
|
||||
# undef LDBL_EPSILON
|
||||
# define LDBL_EPSILON 1.0842021724855044340E-19L
|
||||
/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
|
||||
# undef LDBL_MIN_EXP
|
||||
# define LDBL_MIN_EXP (-16381)
|
||||
/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
|
||||
# undef LDBL_MAX_EXP
|
||||
# define LDBL_MAX_EXP 16384
|
||||
/* Minimum positive normalized number. */
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 3.3621031431120935063E-4932L
|
||||
/* Maximum representable finite number. */
|
||||
# undef LDBL_MAX
|
||||
# define LDBL_MAX 1.1897314953572317650E+4932L
|
||||
/* Minimum e such that 10^e is in the range of normalized numbers. */
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# define LDBL_MIN_10_EXP (-4931)
|
||||
/* Maximum e such that 10^e is in the range of representable finite numbers. */
|
||||
# undef LDBL_MAX_10_EXP
|
||||
# define LDBL_MAX_10_EXP 4932
|
||||
#endif
|
||||
|
||||
/* On FreeBSD/x86 6.4, the 'long double' type really has only 53 bits of
|
||||
precision in the compiler but 64 bits of precision at runtime. See
|
||||
<https://lists.gnu.org/r/bug-gnulib/2008-07/msg00063.html>. */
|
||||
#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
|
||||
/* Number of mantissa units, in base FLT_RADIX. */
|
||||
# undef LDBL_MANT_DIG
|
||||
# define LDBL_MANT_DIG 64
|
||||
/* Number of decimal digits that is sufficient for representing a number. */
|
||||
# undef LDBL_DIG
|
||||
# define LDBL_DIG 18
|
||||
/* x-1 where x is the smallest representable number > 1. */
|
||||
# undef LDBL_EPSILON
|
||||
# define LDBL_EPSILON 1.084202172485504434007452800869941711426e-19L /* 2^-63 */
|
||||
/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
|
||||
# undef LDBL_MIN_EXP
|
||||
# define LDBL_MIN_EXP (-16381)
|
||||
/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
|
||||
# undef LDBL_MAX_EXP
|
||||
# define LDBL_MAX_EXP 16384
|
||||
/* Minimum positive normalized number. */
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 3.362103143112093506262677817321752E-4932L /* = 0x1p-16382L */
|
||||
/* Maximum representable finite number. */
|
||||
# undef LDBL_MAX
|
||||
/* LDBL_MAX is represented as { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }.
|
||||
But the largest literal that GCC allows us to write is
|
||||
0x0.fffffffffffff8p16384L = { 0xFFFFF800, 0xFFFFFFFF, 32766 }.
|
||||
So, define it like this through a reference to an external variable
|
||||
|
||||
const unsigned int LDBL_MAX[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 32766 };
|
||||
extern const long double LDBL_MAX;
|
||||
|
||||
Unfortunately, this is not a constant expression. */
|
||||
# if !GNULIB_defined_long_double_union
|
||||
union gl_long_double_union
|
||||
{
|
||||
struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd;
|
||||
long double ld;
|
||||
};
|
||||
# define GNULIB_defined_long_double_union 1
|
||||
# endif
|
||||
extern const union gl_long_double_union gl_LDBL_MAX;
|
||||
# define LDBL_MAX (gl_LDBL_MAX.ld)
|
||||
/* Minimum e such that 10^e is in the range of normalized numbers. */
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# define LDBL_MIN_10_EXP (-4931)
|
||||
/* Maximum e such that 10^e is in the range of representable finite numbers. */
|
||||
# undef LDBL_MAX_10_EXP
|
||||
# define LDBL_MAX_10_EXP 4932
|
||||
#endif
|
||||
|
||||
/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are
|
||||
wrong.
|
||||
On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong. */
|
||||
#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
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
|
||||
#endif
|
||||
#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
|
||||
# undef LDBL_MAX
|
||||
/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
|
||||
It is not easy to define:
|
||||
#define LDBL_MAX 1.79769313486231580793728971405302307166e308L
|
||||
is too small, whereas
|
||||
#define LDBL_MAX 1.79769313486231580793728971405302307167e308L
|
||||
is too large. Apparently a bug in GCC decimal-to-binary conversion.
|
||||
Also, I can't get values larger than
|
||||
#define LDBL63 ((long double) (1ULL << 63))
|
||||
#define LDBL882 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
|
||||
#define LDBL945 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
|
||||
#define LDBL1008 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
|
||||
#define LDBL_MAX (LDBL1008 * 65535.0L + LDBL945 * (long double) 9223372036821221375ULL + LDBL882 * (long double) 4611686018427387904ULL)
|
||||
which is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xF8000000 }.
|
||||
So, define it like this through a reference to an external variable
|
||||
|
||||
const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL };
|
||||
extern const long double LDBL_MAX;
|
||||
|
||||
or through a pointer cast
|
||||
|
||||
#define LDBL_MAX \
|
||||
(*(const long double *) (double[]) { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL })
|
||||
|
||||
Unfortunately, this is not a constant expression, and the latter expression
|
||||
does not work well when GCC is optimizing.. */
|
||||
# if !GNULIB_defined_long_double_union
|
||||
union gl_long_double_union
|
||||
{
|
||||
struct { double hi; double lo; } dd;
|
||||
long double ld;
|
||||
};
|
||||
# define GNULIB_defined_long_double_union 1
|
||||
# endif
|
||||
extern const union gl_long_double_union gl_LDBL_MAX;
|
||||
# define LDBL_MAX (gl_LDBL_MAX.ld)
|
||||
#endif
|
||||
|
||||
/* On IRIX 6.5, with cc, the value of LDBL_MANT_DIG is wrong.
|
||||
On IRIX 6.5, with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_EPSILON
|
||||
are wrong. */
|
||||
#if defined __sgi && (LDBL_MANT_DIG >= 106)
|
||||
# undef LDBL_MANT_DIG
|
||||
# define LDBL_MANT_DIG 106
|
||||
# if defined __GNUC__
|
||||
# undef LDBL_MIN_EXP
|
||||
# define LDBL_MIN_EXP DBL_MIN_EXP
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
|
||||
# undef LDBL_EPSILON
|
||||
# define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @REPLACE_ITOLD@
|
||||
/* Pull in a function that fixes the 'int' to 'long double' conversion
|
||||
of glibc 2.7. */
|
||||
extern
|
||||
# ifdef __cplusplus
|
||||
"C"
|
||||
# endif
|
||||
void _Qp_itoq (long double *, int);
|
||||
static void (*_gl_float_fix_itold) (long double *, int) = _Qp_itoq;
|
||||
#endif
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_FLOAT_H */
|
||||
#endif /* _@GUARD_PREFIX@_FLOAT_H */
|
108
lib/fpucw.h
108
lib/fpucw.h
|
@ -1,108 +0,0 @@
|
|||
/* Manipulating the FPU control word. -*- coding: utf-8 -*-
|
||||
Copyright (C) 2007-2023 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2007.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FPUCW_H
|
||||
#define _FPUCW_H
|
||||
|
||||
/* The i386 floating point hardware (the 387 compatible FPU, not the modern
|
||||
SSE/SSE2 hardware) has a controllable rounding precision. It is specified
|
||||
through the 'PC' bits in the FPU control word ('fctrl' register). (See
|
||||
the GNU libc i386 <fpu_control.h> header for details.)
|
||||
|
||||
On some platforms, such as Linux or Solaris, the default precision setting
|
||||
is set to "extended precision". This means that 'long double' instructions
|
||||
operate correctly, but 'double' computations often produce slightly
|
||||
different results as on strictly IEEE 754 conforming systems.
|
||||
|
||||
On some platforms, such as NetBSD, the default precision is set to
|
||||
"double precision". This means that 'long double' instructions will operate
|
||||
only as 'double', i.e. lead to wrong results. Similarly on FreeBSD 6.4, at
|
||||
least for the division of 'long double' numbers.
|
||||
|
||||
The FPU control word is under control of the application, i.e. it is
|
||||
not required to be set either way by the ABI. (In fact, the i386 ABI
|
||||
https://www.linux-mips.org/pub/linux/mips/doc/ABI/abi386-4.pdf page 3-12 = page 38
|
||||
is not clear about it. But in any case, gcc treats the control word
|
||||
like a "preserved" register: it emits code that assumes that the control
|
||||
word is preserved across calls, and it restores the control word at the
|
||||
end of functions that modify it.)
|
||||
|
||||
See Vincent Lefèvre's page https://www.vinc17.net/research/extended.en.html
|
||||
for a good explanation.
|
||||
See https://web.archive.org/web/20060905133417/http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html
|
||||
some argumentation which setting should be the default. */
|
||||
|
||||
/* This header file provides the following facilities:
|
||||
fpucw_t integral type holding the value of 'fctrl'
|
||||
FPU_PC_MASK bit mask denoting the precision control
|
||||
FPU_PC_DOUBLE precision control for 53 bits mantissa
|
||||
FPU_PC_EXTENDED precision control for 64 bits mantissa
|
||||
GET_FPUCW () yields the current FPU control word
|
||||
SET_FPUCW (word) sets the FPU control word
|
||||
DECL_LONG_DOUBLE_ROUNDING variable declaration for
|
||||
BEGIN/END_LONG_DOUBLE_ROUNDING
|
||||
BEGIN_LONG_DOUBLE_ROUNDING () starts a sequence of instructions with
|
||||
'long double' safe operation precision
|
||||
END_LONG_DOUBLE_ROUNDING () ends a sequence of instructions with
|
||||
'long double' safe operation precision
|
||||
*/
|
||||
|
||||
/* Inline assembler like this works only with GNU C and clang. */
|
||||
#if (defined __i386__ || defined __x86_64__) && (defined __GNUC__ || defined __clang__)
|
||||
|
||||
typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */
|
||||
|
||||
# define FPU_PC_MASK 0x0300
|
||||
# define FPU_PC_DOUBLE 0x200 /* glibc calls this _FPU_DOUBLE */
|
||||
# define FPU_PC_EXTENDED 0x300 /* glibc calls this _FPU_EXTENDED */
|
||||
|
||||
# define GET_FPUCW() __extension__ \
|
||||
({ fpucw_t _cw; \
|
||||
__asm__ __volatile__ ("fnstcw %0" : "=m" (*&_cw)); \
|
||||
_cw; \
|
||||
})
|
||||
# define SET_FPUCW(word) __extension__ \
|
||||
(void)({ fpucw_t _ncw = (word); \
|
||||
__asm__ __volatile__ ("fldcw %0" : : "m" (*&_ncw)); \
|
||||
})
|
||||
|
||||
# define DECL_LONG_DOUBLE_ROUNDING \
|
||||
fpucw_t oldcw;
|
||||
# define BEGIN_LONG_DOUBLE_ROUNDING() \
|
||||
(void)(oldcw = GET_FPUCW (), \
|
||||
SET_FPUCW ((oldcw & ~FPU_PC_MASK) | FPU_PC_EXTENDED))
|
||||
# define END_LONG_DOUBLE_ROUNDING() \
|
||||
SET_FPUCW (oldcw)
|
||||
|
||||
#else
|
||||
|
||||
typedef unsigned int fpucw_t;
|
||||
|
||||
# define FPU_PC_MASK 0
|
||||
# define FPU_PC_DOUBLE 0
|
||||
# define FPU_PC_EXTENDED 0
|
||||
|
||||
# define GET_FPUCW() 0
|
||||
# define SET_FPUCW(word) (void)(word)
|
||||
|
||||
# define DECL_LONG_DOUBLE_ROUNDING
|
||||
# define BEGIN_LONG_DOUBLE_ROUNDING()
|
||||
# define END_LONG_DOUBLE_ROUNDING()
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _FPUCW_H */
|
168
lib/frexp.c
168
lib/frexp.c
|
@ -1,168 +0,0 @@
|
|||
/* Split a double into fraction and mantissa.
|
||||
Copyright (C) 2007-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paolo Bonzini <bonzini@gnu.org>, 2003, and
|
||||
Bruno Haible <bruno@clisp.org>, 2007. */
|
||||
|
||||
#if ! defined USE_LONG_DOUBLE
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#include <math.h>
|
||||
|
||||
#include <float.h>
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# include "isnanl-nolibm.h"
|
||||
# include "fpucw.h"
|
||||
#else
|
||||
# include "isnand-nolibm.h"
|
||||
#endif
|
||||
|
||||
/* This file assumes FLT_RADIX = 2. If FLT_RADIX is a power of 2 greater
|
||||
than 2, or not even a power of 2, some rounding errors can occur, so that
|
||||
then the returned mantissa is only guaranteed to be <= 1.0, not < 1.0. */
|
||||
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# define FUNC frexpl
|
||||
# define DOUBLE long double
|
||||
# define ISNAN isnanl
|
||||
# define DECL_ROUNDING DECL_LONG_DOUBLE_ROUNDING
|
||||
# define BEGIN_ROUNDING() BEGIN_LONG_DOUBLE_ROUNDING ()
|
||||
# define END_ROUNDING() END_LONG_DOUBLE_ROUNDING ()
|
||||
# define L_(literal) literal##L
|
||||
#else
|
||||
# define FUNC frexp
|
||||
# define DOUBLE double
|
||||
# define ISNAN isnand
|
||||
# define DECL_ROUNDING
|
||||
# define BEGIN_ROUNDING()
|
||||
# define END_ROUNDING()
|
||||
# define L_(literal) literal
|
||||
#endif
|
||||
|
||||
DOUBLE
|
||||
FUNC (DOUBLE x, int *expptr)
|
||||
{
|
||||
int sign;
|
||||
int exponent;
|
||||
DECL_ROUNDING
|
||||
|
||||
/* Test for NaN, infinity, and zero. */
|
||||
if (ISNAN (x) || x + x == x)
|
||||
{
|
||||
*expptr = 0;
|
||||
return x;
|
||||
}
|
||||
|
||||
sign = 0;
|
||||
if (x < 0)
|
||||
{
|
||||
x = - x;
|
||||
sign = -1;
|
||||
}
|
||||
|
||||
BEGIN_ROUNDING ();
|
||||
|
||||
{
|
||||
/* Since the exponent is an 'int', it fits in 64 bits. Therefore the
|
||||
loops are executed no more than 64 times. */
|
||||
DOUBLE pow2[64]; /* pow2[i] = 2^2^i */
|
||||
DOUBLE powh[64]; /* powh[i] = 2^-2^i */
|
||||
int i;
|
||||
|
||||
exponent = 0;
|
||||
if (x >= L_(1.0))
|
||||
{
|
||||
/* A positive exponent. */
|
||||
DOUBLE pow2_i; /* = pow2[i] */
|
||||
DOUBLE powh_i; /* = powh[i] */
|
||||
|
||||
/* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
|
||||
x * 2^exponent = argument, x >= 1.0. */
|
||||
for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
|
||||
;
|
||||
i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
|
||||
{
|
||||
if (x >= pow2_i)
|
||||
{
|
||||
exponent += (1 << i);
|
||||
x *= powh_i;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
pow2[i] = pow2_i;
|
||||
powh[i] = powh_i;
|
||||
}
|
||||
/* Avoid making x too small, as it could become a denormalized
|
||||
number and thus lose precision. */
|
||||
while (i > 0 && x < pow2[i - 1])
|
||||
{
|
||||
i--;
|
||||
powh_i = powh[i];
|
||||
}
|
||||
exponent += (1 << i);
|
||||
x *= powh_i;
|
||||
/* Here 2^-2^i <= x < 1.0. */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A negative or zero exponent. */
|
||||
DOUBLE pow2_i; /* = pow2[i] */
|
||||
DOUBLE powh_i; /* = powh[i] */
|
||||
|
||||
/* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
|
||||
x * 2^exponent = argument, x < 1.0. */
|
||||
for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
|
||||
;
|
||||
i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
|
||||
{
|
||||
if (x < powh_i)
|
||||
{
|
||||
exponent -= (1 << i);
|
||||
x *= pow2_i;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
pow2[i] = pow2_i;
|
||||
powh[i] = powh_i;
|
||||
}
|
||||
/* Here 2^-2^i <= x < 1.0. */
|
||||
}
|
||||
|
||||
/* Invariants: x * 2^exponent = argument, and 2^-2^i <= x < 1.0. */
|
||||
while (i > 0)
|
||||
{
|
||||
i--;
|
||||
if (x < powh[i])
|
||||
{
|
||||
exponent -= (1 << i);
|
||||
x *= pow2[i];
|
||||
}
|
||||
}
|
||||
/* Here 0.5 <= x < 1.0. */
|
||||
}
|
||||
|
||||
if (sign < 0)
|
||||
x = - x;
|
||||
|
||||
END_ROUNDING ();
|
||||
|
||||
*expptr = exponent;
|
||||
return x;
|
||||
}
|
35
lib/frexpl.c
35
lib/frexpl.c
|
@ -1,35 +0,0 @@
|
|||
/* Split a 'long double' into fraction and mantissa.
|
||||
Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
|
||||
|
||||
/* Specification. */
|
||||
# include <math.h>
|
||||
|
||||
long double
|
||||
frexpl (long double x, int *expptr)
|
||||
{
|
||||
return frexp (x, expptr);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
# define USE_LONG_DOUBLE
|
||||
# include "frexp.c"
|
||||
|
||||
#endif
|
|
@ -1,84 +0,0 @@
|
|||
/* Set the error indicator of a stream.
|
||||
Copyright (C) 2007-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "fseterr.h"
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include "stdio-impl.h"
|
||||
|
||||
/* This file is not used on systems that have the __fseterr function,
|
||||
namely musl libc. */
|
||||
|
||||
void
|
||||
fseterr (FILE *fp)
|
||||
{
|
||||
/* Most systems provide FILE as a struct and the necessary bitmask in
|
||||
<stdio.h>, because they need it for implementing getc() and putc() as
|
||||
fast macros. */
|
||||
#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
|
||||
/* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
fp->_flags |= _IO_ERR_SEEN;
|
||||
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
|
||||
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
|
||||
fp_->_flags |= __SERR;
|
||||
#elif defined __EMX__ /* emx+gcc */
|
||||
fp->_flags |= _IOERR;
|
||||
#elif defined __minix /* Minix */
|
||||
fp->_flags |= _IOERR;
|
||||
#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
|
||||
fp_->_flag |= _IOERR;
|
||||
#elif defined __UCLIBC__ /* uClibc */
|
||||
fp->__modeflags |= __FLAG_ERROR;
|
||||
#elif defined __QNX__ /* QNX */
|
||||
fp->_Mode |= 0x200 /* _MERR */;
|
||||
#elif defined __MINT__ /* Atari FreeMiNT */
|
||||
fp->__error = 1;
|
||||
#elif defined EPLAN9 /* Plan9 */
|
||||
if (fp->state != 0 /* CLOSED */)
|
||||
fp->state = 5 /* ERR */;
|
||||
#elif 0 /* unknown */
|
||||
/* Portable fallback, based on an idea by Rich Felker.
|
||||
Wow! 6 system calls for something that is just a bit operation!
|
||||
Not activated on any system, because there is no way to repair FP when
|
||||
the sequence of system calls fails, and library code should not call
|
||||
abort(). */
|
||||
int saved_errno;
|
||||
int fd;
|
||||
int fd2;
|
||||
|
||||
saved_errno = errno;
|
||||
fflush (fp);
|
||||
fd = fileno (fp);
|
||||
fd2 = dup (fd);
|
||||
if (fd2 >= 0)
|
||||
{
|
||||
close (fd);
|
||||
fputc ('\0', fp); /* This should set the error indicator. */
|
||||
fflush (fp); /* Or this. */
|
||||
if (dup2 (fd2, fd) < 0)
|
||||
/* Whee... we botched the stream and now cannot restore it! */
|
||||
abort ();
|
||||
close (fd2);
|
||||
}
|
||||
errno = saved_errno;
|
||||
#else
|
||||
#error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib."
|
||||
#endif
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
/* Set the error indicator of a stream.
|
||||
Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FSETERR_H
|
||||
#define _FSETERR_H
|
||||
|
||||
/* This file uses HAVE___FSETERR. */
|
||||
#if !_GL_CONFIG_H_INCLUDED
|
||||
#error "Please include config.h first."
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Set the error indicator of the stream FP.
|
||||
The "error indicator" is set when an I/O operation on the stream fails, and
|
||||
is cleared (together with the "end-of-file" indicator) by clearerr (FP). */
|
||||
|
||||
#if HAVE___FSETERR /* musl libc */
|
||||
|
||||
# include <stdio_ext.h>
|
||||
# define fseterr(fp) __fseterr (fp)
|
||||
|
||||
#else
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
extern void fseterr (FILE *fp);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _FSETERR_H */
|
883
lib/gnulib.mk.in
883
lib/gnulib.mk.in
File diff suppressed because it is too large
Load diff
190
lib/isnan.c
190
lib/isnan.c
|
@ -1,190 +0,0 @@
|
|||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
/* Specification found in math.h or isnanl-nolibm.h. */
|
||||
extern int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
|
||||
#elif ! defined USE_FLOAT
|
||||
/* Specification found in math.h or isnand-nolibm.h. */
|
||||
extern int rpl_isnand (double x);
|
||||
#else /* defined USE_FLOAT */
|
||||
/* Specification found in math.h or isnanf-nolibm.h. */
|
||||
extern int rpl_isnanf (float x);
|
||||
#endif
|
||||
|
||||
#include <float.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "float+.h"
|
||||
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# define FUNC rpl_isnanl
|
||||
# define DOUBLE long double
|
||||
# define MAX_EXP LDBL_MAX_EXP
|
||||
# define MIN_EXP LDBL_MIN_EXP
|
||||
# if defined LDBL_EXPBIT0_WORD && defined LDBL_EXPBIT0_BIT
|
||||
# define KNOWN_EXPBIT0_LOCATION
|
||||
# define EXPBIT0_WORD LDBL_EXPBIT0_WORD
|
||||
# define EXPBIT0_BIT LDBL_EXPBIT0_BIT
|
||||
# endif
|
||||
# define SIZE SIZEOF_LDBL
|
||||
# define L_(literal) literal##L
|
||||
#elif ! defined USE_FLOAT
|
||||
# define FUNC rpl_isnand
|
||||
# define DOUBLE double
|
||||
# define MAX_EXP DBL_MAX_EXP
|
||||
# define MIN_EXP DBL_MIN_EXP
|
||||
# if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
|
||||
# define KNOWN_EXPBIT0_LOCATION
|
||||
# define EXPBIT0_WORD DBL_EXPBIT0_WORD
|
||||
# define EXPBIT0_BIT DBL_EXPBIT0_BIT
|
||||
# endif
|
||||
# define SIZE SIZEOF_DBL
|
||||
# define L_(literal) literal
|
||||
#else /* defined USE_FLOAT */
|
||||
# define FUNC rpl_isnanf
|
||||
# define DOUBLE float
|
||||
# define MAX_EXP FLT_MAX_EXP
|
||||
# define MIN_EXP FLT_MIN_EXP
|
||||
# if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
|
||||
# define KNOWN_EXPBIT0_LOCATION
|
||||
# define EXPBIT0_WORD FLT_EXPBIT0_WORD
|
||||
# define EXPBIT0_BIT FLT_EXPBIT0_BIT
|
||||
# endif
|
||||
# define SIZE SIZEOF_FLT
|
||||
# define L_(literal) literal##f
|
||||
#endif
|
||||
|
||||
#define EXP_MASK ((MAX_EXP - MIN_EXP) | 7)
|
||||
|
||||
#define NWORDS \
|
||||
((sizeof (DOUBLE) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
|
||||
typedef union { DOUBLE value; unsigned int word[NWORDS]; } memory_double;
|
||||
|
||||
/* Most hosts nowadays use IEEE floating point, so they use IEC 60559
|
||||
representations, have infinities and NaNs, and do not trap on
|
||||
exceptions. Define IEEE_FLOATING_POINT if this host is one of the
|
||||
typical ones. The C23 macro __STDC_IEC_60559_BFP__ macro (or its cousin,
|
||||
the now-obsolescent C11 macro __STDC_IEC_559__) is close to what is
|
||||
wanted here, but is not quite right because this file does not require
|
||||
all the features of C23 Annex F (and works even with pre-C11 platforms,
|
||||
for that matter). */
|
||||
|
||||
#define IEEE_FLOATING_POINT (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \
|
||||
&& FLT_MIN_EXP == -125 && FLT_MAX_EXP == 128)
|
||||
|
||||
int
|
||||
FUNC (DOUBLE x)
|
||||
{
|
||||
#if defined KNOWN_EXPBIT0_LOCATION && IEEE_FLOATING_POINT
|
||||
# if defined USE_LONG_DOUBLE && ((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
|
||||
/* Special CPU dependent code is needed to treat bit patterns outside the
|
||||
IEEE 754 specification (such as Pseudo-NaNs, Pseudo-Infinities,
|
||||
Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals) as NaNs.
|
||||
These bit patterns are:
|
||||
- exponent = 0x0001..0x7FFF, mantissa bit 63 = 0,
|
||||
- exponent = 0x0000, mantissa bit 63 = 1.
|
||||
The NaN bit pattern is:
|
||||
- exponent = 0x7FFF, mantissa >= 0x8000000000000001. */
|
||||
memory_double m;
|
||||
unsigned int exponent;
|
||||
|
||||
m.value = x;
|
||||
exponent = (m.word[EXPBIT0_WORD] >> EXPBIT0_BIT) & EXP_MASK;
|
||||
# ifdef WORDS_BIGENDIAN
|
||||
/* Big endian: EXPBIT0_WORD = 0, EXPBIT0_BIT = 16. */
|
||||
if (exponent == 0)
|
||||
return 1 & (m.word[0] >> 15);
|
||||
else if (exponent == EXP_MASK)
|
||||
return (((m.word[0] ^ 0x8000U) << 16) | m.word[1] | (m.word[2] >> 16)) != 0;
|
||||
else
|
||||
return 1 & ~(m.word[0] >> 15);
|
||||
# else
|
||||
/* Little endian: EXPBIT0_WORD = 2, EXPBIT0_BIT = 0. */
|
||||
if (exponent == 0)
|
||||
return (m.word[1] >> 31);
|
||||
else if (exponent == EXP_MASK)
|
||||
return ((m.word[1] ^ 0x80000000U) | m.word[0]) != 0;
|
||||
else
|
||||
return (m.word[1] >> 31) ^ 1;
|
||||
# endif
|
||||
# else
|
||||
/* Be careful to not do any floating-point operation on x, such as x == x,
|
||||
because x may be a signaling NaN. */
|
||||
# if defined __SUNPRO_C || defined __ICC || defined _MSC_VER \
|
||||
|| defined __DECC || defined __TINYC__ \
|
||||
|| (defined __sgi && !defined __GNUC__)
|
||||
/* The Sun C 5.0, Intel ICC 10.0, Microsoft Visual C/C++ 9.0, Compaq (ex-DEC)
|
||||
6.4, and TinyCC compilers don't recognize the initializers as constant
|
||||
expressions. The Compaq compiler also fails when constant-folding
|
||||
0.0 / 0.0 even when constant-folding is not required. The Microsoft
|
||||
Visual C/C++ compiler also fails when constant-folding 1.0 / 0.0 even
|
||||
when constant-folding is not required. The SGI MIPSpro C compiler
|
||||
complains about "floating-point operation result is out of range". */
|
||||
static DOUBLE zero = L_(0.0);
|
||||
memory_double nan;
|
||||
DOUBLE plus_inf = L_(1.0) / zero;
|
||||
DOUBLE minus_inf = -L_(1.0) / zero;
|
||||
nan.value = zero / zero;
|
||||
# else
|
||||
static memory_double nan = { L_(0.0) / L_(0.0) };
|
||||
static DOUBLE plus_inf = L_(1.0) / L_(0.0);
|
||||
static DOUBLE minus_inf = -L_(1.0) / L_(0.0);
|
||||
# endif
|
||||
{
|
||||
memory_double m;
|
||||
|
||||
/* A NaN can be recognized through its exponent. But exclude +Infinity and
|
||||
-Infinity, which have the same exponent. */
|
||||
m.value = x;
|
||||
if (((m.word[EXPBIT0_WORD] ^ nan.word[EXPBIT0_WORD])
|
||||
& (EXP_MASK << EXPBIT0_BIT))
|
||||
== 0)
|
||||
return (memcmp (&m.value, &plus_inf, SIZE) != 0
|
||||
&& memcmp (&m.value, &minus_inf, SIZE) != 0);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
#else
|
||||
/* The configuration did not find sufficient information, or does
|
||||
not use IEEE floating point. Give up about the signaling NaNs;
|
||||
handle only the quiet NaNs. */
|
||||
if (x == x)
|
||||
{
|
||||
# if defined USE_LONG_DOUBLE && ((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
|
||||
/* Detect any special bit patterns that pass ==; see comment above. */
|
||||
memory_double m1;
|
||||
memory_double m2;
|
||||
|
||||
memset (&m1.value, 0, SIZE);
|
||||
memset (&m2.value, 0, SIZE);
|
||||
m1.value = x;
|
||||
m2.value = x + (x ? 0.0L : -0.0L);
|
||||
if (memcmp (&m1.value, &m2.value, SIZE) != 0)
|
||||
return 1;
|
||||
# endif
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
#endif
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file uses HAVE_ISNAND_IN_LIBC. */
|
||||
#if !_GL_CONFIG_H_INCLUDED
|
||||
#error "Please include config.h first."
|
||||
#endif
|
||||
|
||||
#if HAVE_ISNAND_IN_LIBC
|
||||
/* Get declaration of isnan macro. */
|
||||
# include <math.h>
|
||||
# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
|
||||
/* GCC >= 4.0 and clang provide a type-generic built-in for isnan. */
|
||||
# undef isnand
|
||||
# define isnand(x) __builtin_isnan ((double)(x))
|
||||
# else
|
||||
# undef isnand
|
||||
# define isnand(x) isnan ((double)(x))
|
||||
# endif
|
||||
#else
|
||||
/* Test whether X is a NaN. */
|
||||
# undef isnand
|
||||
# define isnand rpl_isnand
|
||||
extern int isnand (double x);
|
||||
#endif
|
19
lib/isnand.c
19
lib/isnand.c
|
@ -1,19 +0,0 @@
|
|||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2008-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
|
||||
|
||||
#include "isnan.c"
|
|
@ -1,46 +0,0 @@
|
|||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file uses HAVE_ISNANF_IN_LIBC. */
|
||||
#if !_GL_CONFIG_H_INCLUDED
|
||||
#error "Please include config.h first."
|
||||
#endif
|
||||
|
||||
#if HAVE_ISNANF_IN_LIBC
|
||||
/* Get declaration of isnan macro or (older) isnanf function. */
|
||||
# include <math.h>
|
||||
# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
|
||||
/* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
|
||||
GCC >= 4.0 also provides __builtin_isnanf, but clang doesn't. */
|
||||
# undef isnanf
|
||||
# define isnanf(x) __builtin_isnan ((float)(x))
|
||||
# elif defined isnan
|
||||
# undef isnanf
|
||||
# define isnanf(x) isnan ((float)(x))
|
||||
# else
|
||||
/* Get declaration of isnanf(), if not declared in <math.h>. */
|
||||
# if defined __sgi
|
||||
/* We can't include <ieeefp.h>, because it conflicts with our definition of
|
||||
isnand. Therefore declare isnanf separately. */
|
||||
extern int isnanf (float x);
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
/* Test whether X is a NaN. */
|
||||
# undef isnanf
|
||||
# define isnanf rpl_isnanf
|
||||
extern int isnanf (float x);
|
||||
#endif
|
20
lib/isnanf.c
20
lib/isnanf.c
|
@ -1,20 +0,0 @@
|
|||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
|
||||
|
||||
#define USE_FLOAT
|
||||
#include "isnan.c"
|
|
@ -1,39 +0,0 @@
|
|||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file uses HAVE_ISNANL_IN_LIBC. */
|
||||
#if !_GL_CONFIG_H_INCLUDED
|
||||
#error "Please include config.h first."
|
||||
#endif
|
||||
|
||||
#if HAVE_ISNANL_IN_LIBC
|
||||
/* Get declaration of isnan macro or (older) isnanl function. */
|
||||
# include <math.h>
|
||||
# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
|
||||
/* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
|
||||
GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't. */
|
||||
# undef isnanl
|
||||
# define isnanl(x) __builtin_isnan ((long double)(x))
|
||||
# elif defined isnan
|
||||
# undef isnanl
|
||||
# define isnanl(x) isnan ((long double)(x))
|
||||
# endif
|
||||
#else
|
||||
/* Test whether X is a NaN. */
|
||||
# undef isnanl
|
||||
# define isnanl rpl_isnanl
|
||||
extern int isnanl (long double x);
|
||||
#endif
|
20
lib/isnanl.c
20
lib/isnanl.c
|
@ -1,20 +0,0 @@
|
|||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
|
||||
|
||||
#define USE_LONG_DOUBLE
|
||||
#include "isnan.c"
|
28
lib/itold.c
28
lib/itold.c
|
@ -1,28 +0,0 @@
|
|||
/* Replacement for 'int' to 'long double' conversion routine.
|
||||
Copyright (C) 2011-2023 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2011.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <float.h>
|
||||
|
||||
void
|
||||
_Qp_itoq (long double *result, int a)
|
||||
{
|
||||
/* Convert from 'int' to 'double', then from 'double' to 'long double'. */
|
||||
*result = (double) a;
|
||||
}
|
22
lib/math.c
22
lib/math.c
|
@ -1,22 +0,0 @@
|
|||
/* Inline functions for <math.h>.
|
||||
|
||||
Copyright (C) 2012-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#define _GL_MATH_INLINE _GL_EXTERN_INLINE
|
||||
#include "math.h"
|
||||
typedef int dummy;
|
2743
lib/math.in.h
2743
lib/math.in.h
File diff suppressed because it is too large
Load diff
|
@ -172,12 +172,19 @@ see https://www.gnu.org/licenses/. */
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
/* If mp_limb_t is of size smaller than int, plain u*v implies
|
||||
automatic promotion to *signed* int, and then multiply may overflow
|
||||
and cause undefined behavior. Explicitly cast to unsigned int for
|
||||
that case. */
|
||||
#define gmp_umullo_limb(u, v) \
|
||||
((sizeof(mp_limb_t) >= sizeof(int)) ? (u)*(v) : (unsigned int)(u) * (v))
|
||||
|
||||
#define gmp_udiv_qrnnd_preinv(q, r, nh, nl, d, di) \
|
||||
do { \
|
||||
mp_limb_t _qh, _ql, _r, _mask; \
|
||||
gmp_umul_ppmm (_qh, _ql, (nh), (di)); \
|
||||
gmp_add_ssaaaa (_qh, _ql, _qh, _ql, (nh) + 1, (nl)); \
|
||||
_r = (nl) - _qh * (d); \
|
||||
_r = (nl) - gmp_umullo_limb (_qh, (d)); \
|
||||
_mask = -(mp_limb_t) (_r > _ql); /* both > and >= are OK */ \
|
||||
_qh += _mask; \
|
||||
_r += _mask & (d); \
|
||||
|
@ -198,7 +205,7 @@ see https://www.gnu.org/licenses/. */
|
|||
gmp_add_ssaaaa ((q), _q0, (q), _q0, (n2), (n1)); \
|
||||
\
|
||||
/* Compute the two most significant limbs of n - q'd */ \
|
||||
(r1) = (n1) - (d1) * (q); \
|
||||
(r1) = (n1) - gmp_umullo_limb ((d1), (q)); \
|
||||
gmp_sub_ddmmss ((r1), (r0), (r1), (n0), (d1), (d0)); \
|
||||
gmp_umul_ppmm (_t1, _t0, (d0), (q)); \
|
||||
gmp_sub_ddmmss ((r1), (r0), (r1), (r0), _t1, _t0); \
|
||||
|
|
|
@ -1,306 +0,0 @@
|
|||
/* Decomposed printf argument list.
|
||||
Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2023 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file can be parametrized with the following macros:
|
||||
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
|
||||
PRINTF_FETCHARGS Name of the function to be defined.
|
||||
STATIC Set to 'static' to declare the function static. */
|
||||
|
||||
#ifndef PRINTF_FETCHARGS
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#ifndef PRINTF_FETCHARGS
|
||||
# include "printf-args.h"
|
||||
#endif
|
||||
|
||||
/* Get INT_WIDTH. */
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#endif
|
||||
int
|
||||
PRINTF_FETCHARGS (va_list args, arguments *a)
|
||||
{
|
||||
size_t i;
|
||||
argument *ap;
|
||||
|
||||
for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
|
||||
switch (ap->type)
|
||||
{
|
||||
case TYPE_SCHAR:
|
||||
ap->a.a_schar = va_arg (args, /*signed char*/ int);
|
||||
break;
|
||||
case TYPE_UCHAR:
|
||||
ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
|
||||
break;
|
||||
case TYPE_SHORT:
|
||||
ap->a.a_short = va_arg (args, /*short*/ int);
|
||||
break;
|
||||
case TYPE_USHORT:
|
||||
ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
|
||||
break;
|
||||
case TYPE_INT:
|
||||
ap->a.a_int = va_arg (args, int);
|
||||
break;
|
||||
case TYPE_UINT:
|
||||
ap->a.a_uint = va_arg (args, unsigned int);
|
||||
break;
|
||||
case TYPE_LONGINT:
|
||||
ap->a.a_longint = va_arg (args, long int);
|
||||
break;
|
||||
case TYPE_ULONGINT:
|
||||
ap->a.a_ulongint = va_arg (args, unsigned long int);
|
||||
break;
|
||||
case TYPE_LONGLONGINT:
|
||||
ap->a.a_longlongint = va_arg (args, long long int);
|
||||
break;
|
||||
case TYPE_ULONGLONGINT:
|
||||
ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
|
||||
break;
|
||||
case TYPE_INT8_T:
|
||||
#if INT8_WIDTH < INT_WIDTH
|
||||
ap->a.a_int8_t = va_arg (args, /* int8_t */ int);
|
||||
#else
|
||||
ap->a.a_int8_t = va_arg (args, int8_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_UINT8_T:
|
||||
#if UINT8_WIDTH < INT_WIDTH
|
||||
ap->a.a_uint8_t = va_arg (args, /* uint8_t */ int);
|
||||
#else
|
||||
ap->a.a_uint8_t = va_arg (args, uint8_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_INT16_T:
|
||||
#if INT16_WIDTH < INT_WIDTH
|
||||
ap->a.a_int16_t = va_arg (args, /* int16_t */ int);
|
||||
#else
|
||||
ap->a.a_int16_t = va_arg (args, int16_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_UINT16_T:
|
||||
#if UINT16_WIDTH < INT_WIDTH
|
||||
ap->a.a_uint16_t = va_arg (args, /* uint16_t */ int);
|
||||
#else
|
||||
ap->a.a_uint16_t = va_arg (args, uint16_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_INT32_T:
|
||||
#if INT32_WIDTH < INT_WIDTH
|
||||
ap->a.a_int32_t = va_arg (args, /* int32_t */ int);
|
||||
#else
|
||||
ap->a.a_int32_t = va_arg (args, int32_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_UINT32_T:
|
||||
#if UINT32_WIDTH < INT_WIDTH
|
||||
ap->a.a_uint32_t = va_arg (args, /* uint32_t */ int);
|
||||
#else
|
||||
ap->a.a_uint32_t = va_arg (args, uint32_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_INT64_T:
|
||||
ap->a.a_int64_t = va_arg (args, int64_t);
|
||||
break;
|
||||
case TYPE_UINT64_T:
|
||||
ap->a.a_uint64_t = va_arg (args, uint64_t);
|
||||
break;
|
||||
case TYPE_INT_FAST8_T:
|
||||
#if INT_FAST8_WIDTH < INT_WIDTH
|
||||
ap->a.a_int_fast8_t = va_arg (args, /* int_fast8_t */ int);
|
||||
#else
|
||||
ap->a.a_int_fast8_t = va_arg (args, int_fast8_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_UINT_FAST8_T:
|
||||
#if UINT_FAST8_WIDTH < INT_WIDTH
|
||||
ap->a.a_uint_fast8_t = va_arg (args, /* uint_fast8_t */ int);
|
||||
#else
|
||||
ap->a.a_uint_fast8_t = va_arg (args, uint_fast8_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_INT_FAST16_T:
|
||||
#if INT_FAST16_WIDTH < INT_WIDTH
|
||||
ap->a.a_int_fast16_t = va_arg (args, /* int_fast16_t */ int);
|
||||
#else
|
||||
ap->a.a_int_fast16_t = va_arg (args, int_fast16_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_UINT_FAST16_T:
|
||||
#if UINT_FAST16_WIDTH < INT_WIDTH
|
||||
ap->a.a_uint_fast16_t = va_arg (args, /* uint_fast16_t */ int);
|
||||
#else
|
||||
ap->a.a_uint_fast16_t = va_arg (args, uint_fast16_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_INT_FAST32_T:
|
||||
#if INT_FAST32_WIDTH < INT_WIDTH
|
||||
ap->a.a_int_fast32_t = va_arg (args, /* int_fast32_t */ int);
|
||||
#else
|
||||
ap->a.a_int_fast32_t = va_arg (args, int_fast32_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_UINT_FAST32_T:
|
||||
#if UINT_FAST32_WIDTH < INT_WIDTH
|
||||
ap->a.a_uint_fast32_t = va_arg (args, /* uint_fast32_t */ int);
|
||||
#else
|
||||
ap->a.a_uint_fast32_t = va_arg (args, uint_fast32_t);
|
||||
#endif
|
||||
break;
|
||||
case TYPE_INT_FAST64_T:
|
||||
ap->a.a_int_fast64_t = va_arg (args, int_fast64_t);
|
||||
break;
|
||||
case TYPE_UINT_FAST64_T:
|
||||
ap->a.a_uint_fast64_t = va_arg (args, uint_fast64_t);
|
||||
break;
|
||||
case TYPE_DOUBLE:
|
||||
ap->a.a_double = va_arg (args, double);
|
||||
break;
|
||||
case TYPE_LONGDOUBLE:
|
||||
ap->a.a_longdouble = va_arg (args, long double);
|
||||
break;
|
||||
case TYPE_CHAR:
|
||||
ap->a.a_char = va_arg (args, int);
|
||||
break;
|
||||
#if HAVE_WINT_T
|
||||
case TYPE_WIDE_CHAR:
|
||||
/* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
|
||||
default argument promotions", this is not the case in mingw32,
|
||||
where wint_t is 'unsigned short'. */
|
||||
ap->a.a_wide_char =
|
||||
(sizeof (wint_t) < sizeof (int)
|
||||
? (wint_t) va_arg (args, int)
|
||||
: va_arg (args, wint_t));
|
||||
break;
|
||||
#endif
|
||||
case TYPE_STRING:
|
||||
ap->a.a_string = va_arg (args, const char *);
|
||||
/* A null pointer is an invalid argument for "%s", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_string == NULL)
|
||||
ap->a.a_string = "(NULL)";
|
||||
break;
|
||||
#if HAVE_WCHAR_T
|
||||
case TYPE_WIDE_STRING:
|
||||
ap->a.a_wide_string = va_arg (args, const wchar_t *);
|
||||
/* A null pointer is an invalid argument for "%ls", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_wide_string == NULL)
|
||||
{
|
||||
static const wchar_t wide_null_string[] =
|
||||
{
|
||||
(wchar_t)'(',
|
||||
(wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
|
||||
(wchar_t)')',
|
||||
(wchar_t)0
|
||||
};
|
||||
ap->a.a_wide_string = wide_null_string;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case TYPE_POINTER:
|
||||
ap->a.a_pointer = va_arg (args, void *);
|
||||
break;
|
||||
case TYPE_COUNT_SCHAR_POINTER:
|
||||
ap->a.a_count_schar_pointer = va_arg (args, signed char *);
|
||||
break;
|
||||
case TYPE_COUNT_SHORT_POINTER:
|
||||
ap->a.a_count_short_pointer = va_arg (args, short *);
|
||||
break;
|
||||
case TYPE_COUNT_INT_POINTER:
|
||||
ap->a.a_count_int_pointer = va_arg (args, int *);
|
||||
break;
|
||||
case TYPE_COUNT_LONGINT_POINTER:
|
||||
ap->a.a_count_longint_pointer = va_arg (args, long int *);
|
||||
break;
|
||||
case TYPE_COUNT_LONGLONGINT_POINTER:
|
||||
ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
|
||||
break;
|
||||
case TYPE_COUNT_INT8_T_POINTER:
|
||||
ap->a.a_count_int8_t_pointer = va_arg (args, int8_t *);
|
||||
break;
|
||||
case TYPE_COUNT_INT16_T_POINTER:
|
||||
ap->a.a_count_int16_t_pointer = va_arg (args, int16_t *);
|
||||
break;
|
||||
case TYPE_COUNT_INT32_T_POINTER:
|
||||
ap->a.a_count_int32_t_pointer = va_arg (args, int32_t *);
|
||||
break;
|
||||
case TYPE_COUNT_INT64_T_POINTER:
|
||||
ap->a.a_count_int64_t_pointer = va_arg (args, int64_t *);
|
||||
break;
|
||||
case TYPE_COUNT_INT_FAST8_T_POINTER:
|
||||
ap->a.a_count_int_fast8_t_pointer = va_arg (args, int_fast8_t *);
|
||||
break;
|
||||
case TYPE_COUNT_INT_FAST16_T_POINTER:
|
||||
ap->a.a_count_int_fast16_t_pointer = va_arg (args, int_fast16_t *);
|
||||
break;
|
||||
case TYPE_COUNT_INT_FAST32_T_POINTER:
|
||||
ap->a.a_count_int_fast32_t_pointer = va_arg (args, int_fast32_t *);
|
||||
break;
|
||||
case TYPE_COUNT_INT_FAST64_T_POINTER:
|
||||
ap->a.a_count_int_fast64_t_pointer = va_arg (args, int_fast64_t *);
|
||||
break;
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
case TYPE_U8_STRING:
|
||||
ap->a.a_u8_string = va_arg (args, const uint8_t *);
|
||||
/* A null pointer is an invalid argument for "%U", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_u8_string == NULL)
|
||||
{
|
||||
static const uint8_t u8_null_string[] =
|
||||
{ '(', 'N', 'U', 'L', 'L', ')', 0 };
|
||||
ap->a.a_u8_string = u8_null_string;
|
||||
}
|
||||
break;
|
||||
case TYPE_U16_STRING:
|
||||
ap->a.a_u16_string = va_arg (args, const uint16_t *);
|
||||
/* A null pointer is an invalid argument for "%lU", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_u16_string == NULL)
|
||||
{
|
||||
static const uint16_t u16_null_string[] =
|
||||
{ '(', 'N', 'U', 'L', 'L', ')', 0 };
|
||||
ap->a.a_u16_string = u16_null_string;
|
||||
}
|
||||
break;
|
||||
case TYPE_U32_STRING:
|
||||
ap->a.a_u32_string = va_arg (args, const uint32_t *);
|
||||
/* A null pointer is an invalid argument for "%llU", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_u32_string == NULL)
|
||||
{
|
||||
static const uint32_t u32_null_string[] =
|
||||
{ '(', 'N', 'U', 'L', 'L', ')', 0 };
|
||||
ap->a.a_u32_string = u32_null_string;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
/* Unknown type. */
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -1,205 +0,0 @@
|
|||
/* Decomposed printf argument list.
|
||||
Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2023 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _PRINTF_ARGS_H
|
||||
#define _PRINTF_ARGS_H
|
||||
|
||||
/* This file can be parametrized with the following macros:
|
||||
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
|
||||
PRINTF_FETCHARGS Name of the function to be declared.
|
||||
STATIC Set to 'static' to declare the function static. */
|
||||
|
||||
/* Default parameters. */
|
||||
#ifndef PRINTF_FETCHARGS
|
||||
# define PRINTF_FETCHARGS printf_fetchargs
|
||||
#endif
|
||||
|
||||
/* Get size_t. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get wchar_t. */
|
||||
#if HAVE_WCHAR_T
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
/* Get wint_t. */
|
||||
#if HAVE_WINT_T
|
||||
# include <wchar.h>
|
||||
#endif
|
||||
|
||||
/* Get intN_t, uintN_t, intN_fast_t, uintN_fast_t. */
|
||||
#include <stdint.h>
|
||||
|
||||
/* Get va_list. */
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
/* Argument types */
|
||||
typedef enum
|
||||
{
|
||||
TYPE_NONE,
|
||||
TYPE_SCHAR,
|
||||
TYPE_UCHAR,
|
||||
TYPE_SHORT,
|
||||
TYPE_USHORT,
|
||||
TYPE_INT,
|
||||
TYPE_UINT,
|
||||
TYPE_LONGINT,
|
||||
TYPE_ULONGINT,
|
||||
TYPE_LONGLONGINT,
|
||||
TYPE_ULONGLONGINT,
|
||||
/* According to ISO C 23 § 7.23.6.1, "all exact-width integer types",
|
||||
"all minimum-width integer types", and "all fastest minimum-width integer
|
||||
types" defined in <stdint.h> should be supported. But for portability
|
||||
between platforms, we support only those with N = 8, 16, 32, 64. */
|
||||
TYPE_INT8_T,
|
||||
TYPE_UINT8_T,
|
||||
TYPE_INT16_T,
|
||||
TYPE_UINT16_T,
|
||||
TYPE_INT32_T,
|
||||
TYPE_UINT32_T,
|
||||
TYPE_INT64_T,
|
||||
TYPE_UINT64_T,
|
||||
TYPE_INT_FAST8_T,
|
||||
TYPE_UINT_FAST8_T,
|
||||
TYPE_INT_FAST16_T,
|
||||
TYPE_UINT_FAST16_T,
|
||||
TYPE_INT_FAST32_T,
|
||||
TYPE_UINT_FAST32_T,
|
||||
TYPE_INT_FAST64_T,
|
||||
TYPE_UINT_FAST64_T,
|
||||
TYPE_DOUBLE,
|
||||
TYPE_LONGDOUBLE,
|
||||
TYPE_CHAR,
|
||||
#if HAVE_WINT_T
|
||||
TYPE_WIDE_CHAR,
|
||||
#endif
|
||||
TYPE_STRING,
|
||||
#if HAVE_WCHAR_T
|
||||
TYPE_WIDE_STRING,
|
||||
#endif
|
||||
TYPE_POINTER,
|
||||
TYPE_COUNT_SCHAR_POINTER,
|
||||
TYPE_COUNT_SHORT_POINTER,
|
||||
TYPE_COUNT_INT_POINTER,
|
||||
TYPE_COUNT_LONGINT_POINTER,
|
||||
TYPE_COUNT_LONGLONGINT_POINTER,
|
||||
TYPE_COUNT_INT8_T_POINTER,
|
||||
TYPE_COUNT_INT16_T_POINTER,
|
||||
TYPE_COUNT_INT32_T_POINTER,
|
||||
TYPE_COUNT_INT64_T_POINTER,
|
||||
TYPE_COUNT_INT_FAST8_T_POINTER,
|
||||
TYPE_COUNT_INT_FAST16_T_POINTER,
|
||||
TYPE_COUNT_INT_FAST32_T_POINTER,
|
||||
TYPE_COUNT_INT_FAST64_T_POINTER
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
, TYPE_U8_STRING
|
||||
, TYPE_U16_STRING
|
||||
, TYPE_U32_STRING
|
||||
#endif
|
||||
} arg_type;
|
||||
|
||||
/* Polymorphic argument */
|
||||
typedef struct
|
||||
{
|
||||
arg_type type;
|
||||
union
|
||||
{
|
||||
signed char a_schar;
|
||||
unsigned char a_uchar;
|
||||
short a_short;
|
||||
unsigned short a_ushort;
|
||||
int a_int;
|
||||
unsigned int a_uint;
|
||||
long int a_longint;
|
||||
unsigned long int a_ulongint;
|
||||
long long int a_longlongint;
|
||||
unsigned long long int a_ulonglongint;
|
||||
int8_t a_int8_t;
|
||||
uint8_t a_uint8_t;
|
||||
int16_t a_int16_t;
|
||||
uint16_t a_uint16_t;
|
||||
int32_t a_int32_t;
|
||||
uint32_t a_uint32_t;
|
||||
int64_t a_int64_t;
|
||||
uint64_t a_uint64_t;
|
||||
int_fast8_t a_int_fast8_t;
|
||||
uint_fast8_t a_uint_fast8_t;
|
||||
int_fast16_t a_int_fast16_t;
|
||||
uint_fast16_t a_uint_fast16_t;
|
||||
int_fast32_t a_int_fast32_t;
|
||||
uint_fast32_t a_uint_fast32_t;
|
||||
int_fast64_t a_int_fast64_t;
|
||||
uint_fast64_t a_uint_fast64_t;
|
||||
float a_float; /* unused */
|
||||
double a_double;
|
||||
long double a_longdouble;
|
||||
int a_char;
|
||||
#if HAVE_WINT_T
|
||||
wint_t a_wide_char;
|
||||
#endif
|
||||
const char* a_string;
|
||||
#if HAVE_WCHAR_T
|
||||
const wchar_t* a_wide_string;
|
||||
#endif
|
||||
void* a_pointer;
|
||||
signed char * a_count_schar_pointer;
|
||||
short * a_count_short_pointer;
|
||||
int * a_count_int_pointer;
|
||||
long int * a_count_longint_pointer;
|
||||
long long int * a_count_longlongint_pointer;
|
||||
int8_t * a_count_int8_t_pointer;
|
||||
int16_t * a_count_int16_t_pointer;
|
||||
int32_t * a_count_int32_t_pointer;
|
||||
int64_t * a_count_int64_t_pointer;
|
||||
int_fast8_t * a_count_int_fast8_t_pointer;
|
||||
int_fast16_t * a_count_int_fast16_t_pointer;
|
||||
int_fast32_t * a_count_int_fast32_t_pointer;
|
||||
int_fast64_t * a_count_int_fast64_t_pointer;
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
const uint8_t * a_u8_string;
|
||||
const uint16_t * a_u16_string;
|
||||
const uint32_t * a_u32_string;
|
||||
#endif
|
||||
}
|
||||
a;
|
||||
}
|
||||
argument;
|
||||
|
||||
/* Number of directly allocated arguments (no malloc() needed). */
|
||||
#define N_DIRECT_ALLOC_ARGUMENTS 7
|
||||
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
argument *arg;
|
||||
argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS];
|
||||
}
|
||||
arguments;
|
||||
|
||||
|
||||
/* Fetch the arguments, putting them into a. */
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#else
|
||||
extern
|
||||
#endif
|
||||
int PRINTF_FETCHARGS (va_list args, arguments *a);
|
||||
|
||||
#endif /* _PRINTF_ARGS_H */
|
|
@ -1,190 +0,0 @@
|
|||
/* Split a double into fraction and mantissa, for hexadecimal printf.
|
||||
Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#if ! defined USE_LONG_DOUBLE
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# include "printf-frexpl.h"
|
||||
#else
|
||||
# include "printf-frexp.h"
|
||||
#endif
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# include "fpucw.h"
|
||||
#endif
|
||||
|
||||
/* This file assumes FLT_RADIX = 2. If FLT_RADIX is a power of 2 greater
|
||||
than 2, or not even a power of 2, some rounding errors can occur, so that
|
||||
then the returned mantissa is only guaranteed to be <= 2.0, not < 2.0. */
|
||||
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# define FUNC printf_frexpl
|
||||
# define DOUBLE long double
|
||||
# define MIN_EXP LDBL_MIN_EXP
|
||||
# if HAVE_FREXPL_IN_LIBC && HAVE_LDEXPL_IN_LIBC
|
||||
# define USE_FREXP_LDEXP
|
||||
# define FREXP frexpl
|
||||
# define LDEXP ldexpl
|
||||
# endif
|
||||
# define DECL_ROUNDING DECL_LONG_DOUBLE_ROUNDING
|
||||
# define BEGIN_ROUNDING() BEGIN_LONG_DOUBLE_ROUNDING ()
|
||||
# define END_ROUNDING() END_LONG_DOUBLE_ROUNDING ()
|
||||
# define L_(literal) literal##L
|
||||
#else
|
||||
# define FUNC printf_frexp
|
||||
# define DOUBLE double
|
||||
# define MIN_EXP DBL_MIN_EXP
|
||||
# if HAVE_FREXP_IN_LIBC && HAVE_LDEXP_IN_LIBC
|
||||
# define USE_FREXP_LDEXP
|
||||
# define FREXP frexp
|
||||
# define LDEXP ldexp
|
||||
# endif
|
||||
# define DECL_ROUNDING
|
||||
# define BEGIN_ROUNDING()
|
||||
# define END_ROUNDING()
|
||||
# define L_(literal) literal
|
||||
#endif
|
||||
|
||||
DOUBLE
|
||||
FUNC (DOUBLE x, int *expptr)
|
||||
{
|
||||
int exponent;
|
||||
DECL_ROUNDING
|
||||
|
||||
BEGIN_ROUNDING ();
|
||||
|
||||
#ifdef USE_FREXP_LDEXP
|
||||
/* frexp and ldexp are usually faster than the loop below. */
|
||||
x = FREXP (x, &exponent);
|
||||
|
||||
x = x + x;
|
||||
exponent -= 1;
|
||||
|
||||
if (exponent < MIN_EXP - 1)
|
||||
{
|
||||
x = LDEXP (x, exponent - (MIN_EXP - 1));
|
||||
exponent = MIN_EXP - 1;
|
||||
}
|
||||
#else
|
||||
{
|
||||
/* Since the exponent is an 'int', it fits in 64 bits. Therefore the
|
||||
loops are executed no more than 64 times. */
|
||||
DOUBLE pow2[64]; /* pow2[i] = 2^2^i */
|
||||
DOUBLE powh[64]; /* powh[i] = 2^-2^i */
|
||||
int i;
|
||||
|
||||
exponent = 0;
|
||||
if (x >= L_(1.0))
|
||||
{
|
||||
/* A nonnegative exponent. */
|
||||
{
|
||||
DOUBLE pow2_i; /* = pow2[i] */
|
||||
DOUBLE powh_i; /* = powh[i] */
|
||||
|
||||
/* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
|
||||
x * 2^exponent = argument, x >= 1.0. */
|
||||
for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
|
||||
;
|
||||
i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
|
||||
{
|
||||
if (x >= pow2_i)
|
||||
{
|
||||
exponent += (1 << i);
|
||||
x *= powh_i;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
pow2[i] = pow2_i;
|
||||
powh[i] = powh_i;
|
||||
}
|
||||
}
|
||||
/* Here 1.0 <= x < 2^2^i. */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A negative exponent. */
|
||||
{
|
||||
DOUBLE pow2_i; /* = pow2[i] */
|
||||
DOUBLE powh_i; /* = powh[i] */
|
||||
|
||||
/* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
|
||||
x * 2^exponent = argument, x < 1.0, exponent >= MIN_EXP - 1. */
|
||||
for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
|
||||
;
|
||||
i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
|
||||
{
|
||||
if (exponent - (1 << i) < MIN_EXP - 1)
|
||||
break;
|
||||
|
||||
exponent -= (1 << i);
|
||||
x *= pow2_i;
|
||||
if (x >= L_(1.0))
|
||||
break;
|
||||
|
||||
pow2[i] = pow2_i;
|
||||
powh[i] = powh_i;
|
||||
}
|
||||
}
|
||||
/* Here either x < 1.0 and exponent - 2^i < MIN_EXP - 1 <= exponent,
|
||||
or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
|
||||
|
||||
if (x < L_(1.0))
|
||||
/* Invariants: x * 2^exponent = argument, x < 1.0 and
|
||||
exponent - 2^i < MIN_EXP - 1 <= exponent. */
|
||||
while (i > 0)
|
||||
{
|
||||
i--;
|
||||
if (exponent - (1 << i) >= MIN_EXP - 1)
|
||||
{
|
||||
exponent -= (1 << i);
|
||||
x *= pow2[i];
|
||||
if (x >= L_(1.0))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Here either x < 1.0 and exponent = MIN_EXP - 1,
|
||||
or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
|
||||
}
|
||||
|
||||
/* Invariants: x * 2^exponent = argument, and
|
||||
either x < 1.0 and exponent = MIN_EXP - 1,
|
||||
or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
|
||||
while (i > 0)
|
||||
{
|
||||
i--;
|
||||
if (x >= pow2[i])
|
||||
{
|
||||
exponent += (1 << i);
|
||||
x *= powh[i];
|
||||
}
|
||||
}
|
||||
/* Here either x < 1.0 and exponent = MIN_EXP - 1,
|
||||
or 1.0 <= x < 2.0 and exponent >= MIN_EXP - 1. */
|
||||
}
|
||||
#endif
|
||||
|
||||
END_ROUNDING ();
|
||||
|
||||
*expptr = exponent;
|
||||
return x;
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
/* Split a double into fraction and mantissa, for hexadecimal printf.
|
||||
Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Write a finite, positive number x as
|
||||
x = mantissa * 2^exp
|
||||
where exp >= DBL_MIN_EXP - 1,
|
||||
mantissa < 2.0,
|
||||
if x is not a denormalized number then mantissa >= 1.0.
|
||||
Store exp in *EXPPTR and return mantissa. */
|
||||
extern double printf_frexp (double x, int *expptr);
|
|
@ -1,37 +0,0 @@
|
|||
/* Split a 'long double' into fraction and mantissa, for hexadecimal printf.
|
||||
Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
|
||||
|
||||
/* Specification. */
|
||||
# include "printf-frexpl.h"
|
||||
|
||||
# include "printf-frexp.h"
|
||||
|
||||
long double
|
||||
printf_frexpl (long double x, int *expptr)
|
||||
{
|
||||
return printf_frexp (x, expptr);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
# define USE_LONG_DOUBLE
|
||||
# include "printf-frexp.c"
|
||||
|
||||
#endif
|
|
@ -1,23 +0,0 @@
|
|||
/* Split a 'long double' into fraction and mantissa, for hexadecimal printf.
|
||||
Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Write a finite, positive number x as
|
||||
x = mantissa * 2^exp
|
||||
where exp >= LDBL_MIN_EXP - 1,
|
||||
mantissa < 2.0,
|
||||
if x is not a denormalized number then mantissa >= 1.0.
|
||||
Store exp in *EXPPTR and return mantissa. */
|
||||
extern long double printf_frexpl (long double x, int *expptr);
|
|
@ -1,714 +0,0 @@
|
|||
/* Formatted output to strings.
|
||||
Copyright (C) 1999-2000, 2002-2003, 2006-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file can be parametrized with the following macros:
|
||||
CHAR_T The element type of the format string.
|
||||
CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
|
||||
in the format string are ASCII.
|
||||
DIRECTIVE Structure denoting a format directive.
|
||||
Depends on CHAR_T.
|
||||
DIRECTIVES Structure denoting the set of format directives of a
|
||||
format string. Depends on CHAR_T.
|
||||
PRINTF_PARSE Function that parses a format string.
|
||||
Depends on CHAR_T.
|
||||
STATIC Set to 'static' to declare the function static.
|
||||
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */
|
||||
|
||||
#ifndef PRINTF_PARSE
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#ifndef PRINTF_PARSE
|
||||
# include "printf-parse.h"
|
||||
#endif
|
||||
|
||||
/* Default parameters. */
|
||||
#ifndef PRINTF_PARSE
|
||||
# define PRINTF_PARSE printf_parse
|
||||
# define CHAR_T char
|
||||
# define DIRECTIVE char_directive
|
||||
# define DIRECTIVES char_directives
|
||||
#endif
|
||||
|
||||
/* Get size_t, NULL. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get intmax_t. */
|
||||
#include <stdint.h>
|
||||
|
||||
/* malloc(), realloc(), free(). */
|
||||
#include <stdlib.h>
|
||||
|
||||
/* memcpy(). */
|
||||
#include <string.h>
|
||||
|
||||
/* errno. */
|
||||
#include <errno.h>
|
||||
|
||||
/* Checked size_t computations. */
|
||||
#include "xsize.h"
|
||||
|
||||
#if CHAR_T_ONLY_ASCII
|
||||
/* c_isascii(). */
|
||||
# include "c-ctype.h"
|
||||
#endif
|
||||
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#endif
|
||||
int
|
||||
PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
|
||||
{
|
||||
const CHAR_T *cp = format; /* pointer into format */
|
||||
size_t arg_posn = 0; /* number of regular arguments consumed */
|
||||
size_t d_allocated; /* allocated elements of d->dir */
|
||||
size_t a_allocated; /* allocated elements of a->arg */
|
||||
size_t max_width_length = 0;
|
||||
size_t max_precision_length = 0;
|
||||
|
||||
d->count = 0;
|
||||
d_allocated = N_DIRECT_ALLOC_DIRECTIVES;
|
||||
d->dir = d->direct_alloc_dir;
|
||||
|
||||
a->count = 0;
|
||||
a_allocated = N_DIRECT_ALLOC_ARGUMENTS;
|
||||
a->arg = a->direct_alloc_arg;
|
||||
|
||||
#define REGISTER_ARG(_index_,_type_) \
|
||||
{ \
|
||||
size_t n = (_index_); \
|
||||
if (n >= a_allocated) \
|
||||
{ \
|
||||
size_t memory_size; \
|
||||
argument *memory; \
|
||||
\
|
||||
a_allocated = xtimes (a_allocated, 2); \
|
||||
if (a_allocated <= n) \
|
||||
a_allocated = xsum (n, 1); \
|
||||
memory_size = xtimes (a_allocated, sizeof (argument)); \
|
||||
if (size_overflow_p (memory_size)) \
|
||||
/* Overflow, would lead to out of memory. */ \
|
||||
goto out_of_memory; \
|
||||
memory = (argument *) (a->arg != a->direct_alloc_arg \
|
||||
? realloc (a->arg, memory_size) \
|
||||
: malloc (memory_size)); \
|
||||
if (memory == NULL) \
|
||||
/* Out of memory. */ \
|
||||
goto out_of_memory; \
|
||||
if (a->arg == a->direct_alloc_arg) \
|
||||
memcpy (memory, a->arg, a->count * sizeof (argument)); \
|
||||
a->arg = memory; \
|
||||
} \
|
||||
while (a->count <= n) \
|
||||
a->arg[a->count++].type = TYPE_NONE; \
|
||||
if (a->arg[n].type == TYPE_NONE) \
|
||||
a->arg[n].type = (_type_); \
|
||||
else if (a->arg[n].type != (_type_)) \
|
||||
/* Ambiguous type for positional argument. */ \
|
||||
goto error; \
|
||||
}
|
||||
|
||||
while (*cp != '\0')
|
||||
{
|
||||
CHAR_T c = *cp++;
|
||||
if (c == '%')
|
||||
{
|
||||
size_t arg_index = ARG_NONE;
|
||||
DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
|
||||
|
||||
/* Initialize the next directive. */
|
||||
dp->dir_start = cp - 1;
|
||||
dp->flags = 0;
|
||||
dp->width_start = NULL;
|
||||
dp->width_end = NULL;
|
||||
dp->width_arg_index = ARG_NONE;
|
||||
dp->precision_start = NULL;
|
||||
dp->precision_end = NULL;
|
||||
dp->precision_arg_index = ARG_NONE;
|
||||
dp->arg_index = ARG_NONE;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
n = xsum (xtimes (n, 10), *np - '0');
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
if (size_overflow_p (n))
|
||||
/* n too large, would lead to out of memory later. */
|
||||
goto error;
|
||||
arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Read the flags. */
|
||||
for (;;)
|
||||
{
|
||||
if (*cp == '\'')
|
||||
{
|
||||
dp->flags |= FLAG_GROUP;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '-')
|
||||
{
|
||||
dp->flags |= FLAG_LEFT;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '+')
|
||||
{
|
||||
dp->flags |= FLAG_SHOWSIGN;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == ' ')
|
||||
{
|
||||
dp->flags |= FLAG_SPACE;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '#')
|
||||
{
|
||||
dp->flags |= FLAG_ALT;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '0')
|
||||
{
|
||||
dp->flags |= FLAG_ZERO;
|
||||
cp++;
|
||||
}
|
||||
#if __GLIBC__ >= 2 && !defined __UCLIBC__
|
||||
else if (*cp == 'I')
|
||||
{
|
||||
dp->flags |= FLAG_LOCALIZED;
|
||||
cp++;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/* Parse the field width. */
|
||||
if (*cp == '*')
|
||||
{
|
||||
dp->width_start = cp;
|
||||
cp++;
|
||||
dp->width_end = cp;
|
||||
if (max_width_length < 1)
|
||||
max_width_length = 1;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
n = xsum (xtimes (n, 10), *np - '0');
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
if (size_overflow_p (n))
|
||||
/* n too large, would lead to out of memory later. */
|
||||
goto error;
|
||||
dp->width_arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
if (dp->width_arg_index == ARG_NONE)
|
||||
{
|
||||
dp->width_arg_index = arg_posn++;
|
||||
if (dp->width_arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->width_arg_index, TYPE_INT);
|
||||
}
|
||||
else if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
size_t width_length;
|
||||
|
||||
dp->width_start = cp;
|
||||
for (; *cp >= '0' && *cp <= '9'; cp++)
|
||||
;
|
||||
dp->width_end = cp;
|
||||
width_length = dp->width_end - dp->width_start;
|
||||
if (max_width_length < width_length)
|
||||
max_width_length = width_length;
|
||||
}
|
||||
|
||||
/* Parse the precision. */
|
||||
if (*cp == '.')
|
||||
{
|
||||
cp++;
|
||||
if (*cp == '*')
|
||||
{
|
||||
dp->precision_start = cp - 1;
|
||||
cp++;
|
||||
dp->precision_end = cp;
|
||||
if (max_precision_length < 2)
|
||||
max_precision_length = 2;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
n = xsum (xtimes (n, 10), *np - '0');
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
if (size_overflow_p (n))
|
||||
/* n too large, would lead to out of memory
|
||||
later. */
|
||||
goto error;
|
||||
dp->precision_arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
if (dp->precision_arg_index == ARG_NONE)
|
||||
{
|
||||
dp->precision_arg_index = arg_posn++;
|
||||
if (dp->precision_arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t precision_length;
|
||||
|
||||
dp->precision_start = cp - 1;
|
||||
for (; *cp >= '0' && *cp <= '9'; cp++)
|
||||
;
|
||||
dp->precision_end = cp;
|
||||
precision_length = dp->precision_end - dp->precision_start;
|
||||
if (max_precision_length < precision_length)
|
||||
max_precision_length = precision_length;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
arg_type type;
|
||||
|
||||
/* Parse argument type/size specifiers. */
|
||||
/* Relevant for the conversion characters d, i. */
|
||||
arg_type signed_type = TYPE_INT;
|
||||
/* Relevant for the conversion characters b, o, u, x, X. */
|
||||
arg_type unsigned_type = TYPE_UINT;
|
||||
/* Relevant for the conversion characters n. */
|
||||
arg_type pointer_type = TYPE_COUNT_INT_POINTER;
|
||||
/* Relevant for the conversion characters a, A, e, E, f, F, g, G. */
|
||||
arg_type floatingpoint_type = TYPE_DOUBLE;
|
||||
|
||||
if (*cp == 'h')
|
||||
{
|
||||
if (cp[1] == 'h')
|
||||
{
|
||||
signed_type = TYPE_SCHAR;
|
||||
unsigned_type = TYPE_UCHAR;
|
||||
pointer_type = TYPE_COUNT_SCHAR_POINTER;
|
||||
cp += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
signed_type = TYPE_SHORT;
|
||||
unsigned_type = TYPE_USHORT;
|
||||
pointer_type = TYPE_COUNT_SHORT_POINTER;
|
||||
cp++;
|
||||
}
|
||||
}
|
||||
else if (*cp == 'l')
|
||||
{
|
||||
if (cp[1] == 'l')
|
||||
{
|
||||
signed_type = TYPE_LONGLONGINT;
|
||||
unsigned_type = TYPE_ULONGLONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
|
||||
/* For backward compatibility only. */
|
||||
floatingpoint_type = TYPE_LONGDOUBLE;
|
||||
cp += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
signed_type = TYPE_LONGINT;
|
||||
unsigned_type = TYPE_ULONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGINT_POINTER;
|
||||
cp++;
|
||||
}
|
||||
}
|
||||
else if (*cp == 'j')
|
||||
{
|
||||
if (sizeof (intmax_t) > sizeof (long))
|
||||
{
|
||||
/* intmax_t = long long */
|
||||
signed_type = TYPE_LONGLONGINT;
|
||||
unsigned_type = TYPE_ULONGLONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
|
||||
/* For backward compatibility only. */
|
||||
floatingpoint_type = TYPE_LONGDOUBLE;
|
||||
}
|
||||
else if (sizeof (intmax_t) > sizeof (int))
|
||||
{
|
||||
/* intmax_t = long */
|
||||
signed_type = TYPE_LONGINT;
|
||||
unsigned_type = TYPE_ULONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGINT_POINTER;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'z' || *cp == 'Z')
|
||||
{
|
||||
/* 'z' is standardized in ISO C 99, but glibc uses 'Z'
|
||||
because the warning facility in gcc-2.95.2 understands
|
||||
only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
|
||||
if (sizeof (size_t) > sizeof (long))
|
||||
{
|
||||
/* size_t = unsigned long long */
|
||||
signed_type = TYPE_LONGLONGINT;
|
||||
unsigned_type = TYPE_ULONGLONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
|
||||
/* For backward compatibility only. */
|
||||
floatingpoint_type = TYPE_LONGDOUBLE;
|
||||
}
|
||||
else if (sizeof (size_t) > sizeof (int))
|
||||
{
|
||||
/* size_t = unsigned long */
|
||||
signed_type = TYPE_LONGINT;
|
||||
unsigned_type = TYPE_ULONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGINT_POINTER;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 't')
|
||||
{
|
||||
if (sizeof (ptrdiff_t) > sizeof (long))
|
||||
{
|
||||
/* ptrdiff_t = long long */
|
||||
signed_type = TYPE_LONGLONGINT;
|
||||
unsigned_type = TYPE_ULONGLONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
|
||||
/* For backward compatibility only. */
|
||||
floatingpoint_type = TYPE_LONGDOUBLE;
|
||||
}
|
||||
else if (sizeof (ptrdiff_t) > sizeof (int))
|
||||
{
|
||||
/* ptrdiff_t = long */
|
||||
signed_type = TYPE_LONGINT;
|
||||
unsigned_type = TYPE_ULONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGINT_POINTER;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'w')
|
||||
{
|
||||
/* wN and wfN are standardized in ISO C 23. */
|
||||
if (cp[1] == 'f')
|
||||
{
|
||||
if (cp[2] == '8')
|
||||
{
|
||||
signed_type = TYPE_INT_FAST8_T;
|
||||
unsigned_type = TYPE_UINT_FAST8_T;
|
||||
pointer_type = TYPE_COUNT_INT_FAST8_T_POINTER;
|
||||
cp += 3;
|
||||
}
|
||||
else if (cp[2] == '1' && cp[3] == '6')
|
||||
{
|
||||
signed_type = TYPE_INT_FAST16_T;
|
||||
unsigned_type = TYPE_UINT_FAST16_T;
|
||||
pointer_type = TYPE_COUNT_INT_FAST16_T_POINTER;
|
||||
cp += 4;
|
||||
}
|
||||
else if (cp[2] == '3' && cp[3] == '2')
|
||||
{
|
||||
signed_type = TYPE_INT_FAST32_T;
|
||||
unsigned_type = TYPE_UINT_FAST32_T;
|
||||
pointer_type = TYPE_COUNT_INT_FAST32_T_POINTER;
|
||||
cp += 4;
|
||||
}
|
||||
else if (cp[2] == '6' && cp[3] == '4')
|
||||
{
|
||||
signed_type = TYPE_INT_FAST64_T;
|
||||
unsigned_type = TYPE_UINT_FAST64_T;
|
||||
pointer_type = TYPE_COUNT_INT_FAST64_T_POINTER;
|
||||
cp += 4;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cp[1] == '8')
|
||||
{
|
||||
signed_type = TYPE_INT8_T;
|
||||
unsigned_type = TYPE_UINT8_T;
|
||||
pointer_type = TYPE_COUNT_INT8_T_POINTER;
|
||||
cp += 2;
|
||||
}
|
||||
else if (cp[1] == '1' && cp[2] == '6')
|
||||
{
|
||||
signed_type = TYPE_INT16_T;
|
||||
unsigned_type = TYPE_UINT16_T;
|
||||
pointer_type = TYPE_COUNT_INT16_T_POINTER;
|
||||
cp += 3;
|
||||
}
|
||||
else if (cp[1] == '3' && cp[2] == '2')
|
||||
{
|
||||
signed_type = TYPE_INT32_T;
|
||||
unsigned_type = TYPE_UINT32_T;
|
||||
pointer_type = TYPE_COUNT_INT32_T_POINTER;
|
||||
cp += 3;
|
||||
}
|
||||
else if (cp[1] == '6' && cp[2] == '4')
|
||||
{
|
||||
signed_type = TYPE_INT64_T;
|
||||
unsigned_type = TYPE_UINT64_T;
|
||||
pointer_type = TYPE_COUNT_INT64_T_POINTER;
|
||||
cp += 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (*cp == 'L')
|
||||
{
|
||||
signed_type = TYPE_LONGLONGINT;
|
||||
unsigned_type = TYPE_ULONGLONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
|
||||
floatingpoint_type = TYPE_LONGDOUBLE;
|
||||
cp++;
|
||||
}
|
||||
#if defined __APPLE__ && defined __MACH__
|
||||
/* On Mac OS X 10.3, PRIdMAX is defined as "qd".
|
||||
We cannot change it to "lld" because PRIdMAX must also
|
||||
be understood by the system's printf routines. */
|
||||
else if (*cp == 'q')
|
||||
{
|
||||
if (64 / 8 > sizeof (long))
|
||||
{
|
||||
/* int64_t = long long */
|
||||
signed_type = TYPE_LONGLONGINT;
|
||||
unsigned_type = TYPE_ULONGLONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
|
||||
/* For backward compatibility only. */
|
||||
floatingpoint_type = TYPE_LONGDOUBLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* int64_t = long */
|
||||
signed_type = TYPE_LONGINT;
|
||||
unsigned_type = TYPE_ULONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGINT_POINTER;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
#endif
|
||||
#if defined _WIN32 && ! defined __CYGWIN__
|
||||
/* On native Windows, PRIdMAX is defined as "I64d".
|
||||
We cannot change it to "lld" because PRIdMAX must also
|
||||
be understood by the system's printf routines. */
|
||||
else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
|
||||
{
|
||||
if (64 / 8 > sizeof (long))
|
||||
{
|
||||
/* __int64_t = long long */
|
||||
signed_type = TYPE_LONGLONGINT;
|
||||
unsigned_type = TYPE_ULONGLONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGLONGINT_POINTER;
|
||||
/* For backward compatibility only. */
|
||||
floatingpoint_type = TYPE_LONGDOUBLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* __int64_t = long */
|
||||
signed_type = TYPE_LONGINT;
|
||||
unsigned_type = TYPE_ULONGINT;
|
||||
pointer_type = TYPE_COUNT_LONGINT_POINTER;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Read the conversion character. */
|
||||
c = *cp++;
|
||||
switch (c)
|
||||
{
|
||||
case 'd': case 'i':
|
||||
type = signed_type;
|
||||
break;
|
||||
case 'b': case 'o': case 'u': case 'x': case 'X':
|
||||
#if SUPPORT_GNU_PRINTF_DIRECTIVES \
|
||||
|| (__GLIBC__ + (__GLIBC_MINOR__ >= 35) > 2)
|
||||
case 'B':
|
||||
#endif
|
||||
type = unsigned_type;
|
||||
break;
|
||||
case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
|
||||
case 'a': case 'A':
|
||||
type = floatingpoint_type;
|
||||
break;
|
||||
case 'c':
|
||||
if (signed_type == TYPE_LONGINT
|
||||
/* For backward compatibility only. */
|
||||
|| signed_type == TYPE_LONGLONGINT)
|
||||
#if HAVE_WINT_T
|
||||
type = TYPE_WIDE_CHAR;
|
||||
#else
|
||||
goto error;
|
||||
#endif
|
||||
else
|
||||
type = TYPE_CHAR;
|
||||
break;
|
||||
#if HAVE_WINT_T
|
||||
case 'C':
|
||||
type = TYPE_WIDE_CHAR;
|
||||
c = 'c';
|
||||
break;
|
||||
#endif
|
||||
case 's':
|
||||
if (signed_type == TYPE_LONGINT
|
||||
/* For backward compatibility only. */
|
||||
|| signed_type == TYPE_LONGLONGINT)
|
||||
#if HAVE_WCHAR_T
|
||||
type = TYPE_WIDE_STRING;
|
||||
#else
|
||||
goto error;
|
||||
#endif
|
||||
else
|
||||
type = TYPE_STRING;
|
||||
break;
|
||||
#if HAVE_WCHAR_T
|
||||
case 'S':
|
||||
type = TYPE_WIDE_STRING;
|
||||
c = 's';
|
||||
break;
|
||||
#endif
|
||||
case 'p':
|
||||
type = TYPE_POINTER;
|
||||
break;
|
||||
case 'n':
|
||||
type = pointer_type;
|
||||
break;
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
case 'U':
|
||||
if (signed_type == TYPE_LONGLONGINT)
|
||||
type = TYPE_U32_STRING;
|
||||
else if (signed_type == TYPE_LONGINT)
|
||||
type = TYPE_U16_STRING;
|
||||
else
|
||||
type = TYPE_U8_STRING;
|
||||
break;
|
||||
#endif
|
||||
case '%':
|
||||
type = TYPE_NONE;
|
||||
break;
|
||||
default:
|
||||
/* Unknown conversion character. */
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (type != TYPE_NONE)
|
||||
{
|
||||
dp->arg_index = arg_index;
|
||||
if (dp->arg_index == ARG_NONE)
|
||||
{
|
||||
dp->arg_index = arg_posn++;
|
||||
if (dp->arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->arg_index, type);
|
||||
}
|
||||
dp->conversion = c;
|
||||
dp->dir_end = cp;
|
||||
}
|
||||
|
||||
d->count++;
|
||||
if (d->count >= d_allocated)
|
||||
{
|
||||
size_t memory_size;
|
||||
DIRECTIVE *memory;
|
||||
|
||||
d_allocated = xtimes (d_allocated, 2);
|
||||
memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
|
||||
if (size_overflow_p (memory_size))
|
||||
/* Overflow, would lead to out of memory. */
|
||||
goto out_of_memory;
|
||||
memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir
|
||||
? realloc (d->dir, memory_size)
|
||||
: malloc (memory_size));
|
||||
if (memory == NULL)
|
||||
/* Out of memory. */
|
||||
goto out_of_memory;
|
||||
if (d->dir == d->direct_alloc_dir)
|
||||
memcpy (memory, d->dir, d->count * sizeof (DIRECTIVE));
|
||||
d->dir = memory;
|
||||
}
|
||||
}
|
||||
#if CHAR_T_ONLY_ASCII
|
||||
else if (!c_isascii (c))
|
||||
{
|
||||
/* Non-ASCII character. Not supported. */
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
d->dir[d->count].dir_start = cp;
|
||||
|
||||
d->max_width_length = max_width_length;
|
||||
d->max_precision_length = max_precision_length;
|
||||
return 0;
|
||||
|
||||
error:
|
||||
if (a->arg != a->direct_alloc_arg)
|
||||
free (a->arg);
|
||||
if (d->dir != d->direct_alloc_dir)
|
||||
free (d->dir);
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
|
||||
out_of_memory:
|
||||
if (a->arg != a->direct_alloc_arg)
|
||||
free (a->arg);
|
||||
if (d->dir != d->direct_alloc_dir)
|
||||
free (d->dir);
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#undef PRINTF_PARSE
|
||||
#undef DIRECTIVES
|
||||
#undef DIRECTIVE
|
||||
#undef CHAR_T_ONLY_ASCII
|
||||
#undef CHAR_T
|
|
@ -1,193 +0,0 @@
|
|||
/* Parse printf format string.
|
||||
Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2023 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _PRINTF_PARSE_H
|
||||
#define _PRINTF_PARSE_H
|
||||
|
||||
/* This file can be parametrized with the following macros:
|
||||
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
|
||||
STATIC Set to 'static' to declare the function static. */
|
||||
|
||||
#if HAVE_FEATURES_H
|
||||
# include <features.h> /* for __GLIBC__, __UCLIBC__ */
|
||||
#endif
|
||||
|
||||
#include "printf-args.h"
|
||||
|
||||
|
||||
/* Flags */
|
||||
#define FLAG_GROUP 1 /* ' flag */
|
||||
#define FLAG_LEFT 2 /* - flag */
|
||||
#define FLAG_SHOWSIGN 4 /* + flag */
|
||||
#define FLAG_SPACE 8 /* space flag */
|
||||
#define FLAG_ALT 16 /* # flag */
|
||||
#define FLAG_ZERO 32
|
||||
#if __GLIBC__ >= 2 && !defined __UCLIBC__
|
||||
# define FLAG_LOCALIZED 64 /* I flag, uses localized digits */
|
||||
#endif
|
||||
|
||||
/* arg_index value indicating that no argument is consumed. */
|
||||
#define ARG_NONE (~(size_t)0)
|
||||
|
||||
/* xxx_directive: A parsed directive.
|
||||
xxx_directives: A parsed format string. */
|
||||
|
||||
/* Number of directly allocated directives (no malloc() needed). */
|
||||
#define N_DIRECT_ALLOC_DIRECTIVES 7
|
||||
|
||||
/* A parsed directive. */
|
||||
typedef struct
|
||||
{
|
||||
const char* dir_start;
|
||||
const char* dir_end;
|
||||
int flags;
|
||||
const char* width_start;
|
||||
const char* width_end;
|
||||
size_t width_arg_index;
|
||||
const char* precision_start;
|
||||
const char* precision_end;
|
||||
size_t precision_arg_index;
|
||||
char conversion; /* d i b B o u x X f F e E g G a A c s p n U % but not C S */
|
||||
size_t arg_index;
|
||||
}
|
||||
char_directive;
|
||||
|
||||
/* A parsed format string. */
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
char_directive *dir;
|
||||
size_t max_width_length;
|
||||
size_t max_precision_length;
|
||||
char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
|
||||
}
|
||||
char_directives;
|
||||
|
||||
#if ENABLE_UNISTDIO
|
||||
|
||||
/* A parsed directive. */
|
||||
typedef struct
|
||||
{
|
||||
const uint8_t* dir_start;
|
||||
const uint8_t* dir_end;
|
||||
int flags;
|
||||
const uint8_t* width_start;
|
||||
const uint8_t* width_end;
|
||||
size_t width_arg_index;
|
||||
const uint8_t* precision_start;
|
||||
const uint8_t* precision_end;
|
||||
size_t precision_arg_index;
|
||||
uint8_t conversion; /* d i b B o u x X f F e E g G a A c s p n U % but not C S */
|
||||
size_t arg_index;
|
||||
}
|
||||
u8_directive;
|
||||
|
||||
/* A parsed format string. */
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
u8_directive *dir;
|
||||
size_t max_width_length;
|
||||
size_t max_precision_length;
|
||||
u8_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
|
||||
}
|
||||
u8_directives;
|
||||
|
||||
/* A parsed directive. */
|
||||
typedef struct
|
||||
{
|
||||
const uint16_t* dir_start;
|
||||
const uint16_t* dir_end;
|
||||
int flags;
|
||||
const uint16_t* width_start;
|
||||
const uint16_t* width_end;
|
||||
size_t width_arg_index;
|
||||
const uint16_t* precision_start;
|
||||
const uint16_t* precision_end;
|
||||
size_t precision_arg_index;
|
||||
uint16_t conversion; /* d i b B o u x X f F e E g G a A c s p n U % but not C S */
|
||||
size_t arg_index;
|
||||
}
|
||||
u16_directive;
|
||||
|
||||
/* A parsed format string. */
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
u16_directive *dir;
|
||||
size_t max_width_length;
|
||||
size_t max_precision_length;
|
||||
u16_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
|
||||
}
|
||||
u16_directives;
|
||||
|
||||
/* A parsed directive. */
|
||||
typedef struct
|
||||
{
|
||||
const uint32_t* dir_start;
|
||||
const uint32_t* dir_end;
|
||||
int flags;
|
||||
const uint32_t* width_start;
|
||||
const uint32_t* width_end;
|
||||
size_t width_arg_index;
|
||||
const uint32_t* precision_start;
|
||||
const uint32_t* precision_end;
|
||||
size_t precision_arg_index;
|
||||
uint32_t conversion; /* d i b B o u x X f F e E g G a A c s p n U % but not C S */
|
||||
size_t arg_index;
|
||||
}
|
||||
u32_directive;
|
||||
|
||||
/* A parsed format string. */
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
u32_directive *dir;
|
||||
size_t max_width_length;
|
||||
size_t max_precision_length;
|
||||
u32_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
|
||||
}
|
||||
u32_directives;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Parses the format string. Fills in the number N of directives, and fills
|
||||
in directives[0], ..., directives[N-1], and sets directives[N].dir_start
|
||||
to the end of the format string. Also fills in the arg_type fields of the
|
||||
arguments and the needed count of arguments. */
|
||||
#if ENABLE_UNISTDIO
|
||||
extern int
|
||||
ulc_printf_parse (const char *format, char_directives *d, arguments *a);
|
||||
extern int
|
||||
u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a);
|
||||
extern int
|
||||
u16_printf_parse (const uint16_t *format, u16_directives *d,
|
||||
arguments *a);
|
||||
extern int
|
||||
u32_printf_parse (const uint32_t *format, u32_directives *d,
|
||||
arguments *a);
|
||||
#else
|
||||
# ifdef STATIC
|
||||
STATIC
|
||||
# else
|
||||
extern
|
||||
# endif
|
||||
int printf_parse (const char *format, char_directives *d, arguments *a);
|
||||
#endif
|
||||
|
||||
#endif /* _PRINTF_PARSE_H */
|
40
lib/printf.c
40
lib/printf.c
|
@ -1,40 +0,0 @@
|
|||
/* Formatted output to a stream.
|
||||
Copyright (C) 2007, 2010-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#include <stdio.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/* Print formatted output to standard output.
|
||||
Return string length of formatted string. On error, return a negative
|
||||
value. */
|
||||
int
|
||||
printf (const char *format, ...)
|
||||
{
|
||||
int retval;
|
||||
va_list args;
|
||||
|
||||
va_start (args, format);
|
||||
retval = vfprintf (stdout, format, args);
|
||||
va_end (args);
|
||||
|
||||
return retval;
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
/* signbit() macro: Determine the sign bit of a floating-point number.
|
||||
Copyright (C) 2007-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <math.h>
|
||||
|
||||
#include <string.h>
|
||||
#include "isnand-nolibm.h"
|
||||
#include "float+.h"
|
||||
|
||||
#ifdef gl_signbitd_OPTIMIZED_MACRO
|
||||
# undef gl_signbitd
|
||||
#endif
|
||||
|
||||
int
|
||||
gl_signbitd (double arg)
|
||||
{
|
||||
#if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT
|
||||
/* The use of a union to extract the bits of the representation of a
|
||||
'long double' is safe in practice, despite of the "aliasing rules" of
|
||||
C99, because the GCC docs say
|
||||
"Even with '-fstrict-aliasing', type-punning is allowed, provided the
|
||||
memory is accessed through the union type."
|
||||
and similarly for other compilers. */
|
||||
# define NWORDS \
|
||||
((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
|
||||
union { double value; unsigned int word[NWORDS]; } m;
|
||||
m.value = arg;
|
||||
return (m.word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1;
|
||||
#elif HAVE_COPYSIGN_IN_LIBC
|
||||
return copysign (1.0, arg) < 0;
|
||||
#else
|
||||
/* This does not do the right thing for NaN, but this is irrelevant for
|
||||
most use cases. */
|
||||
if (isnand (arg))
|
||||
return 0;
|
||||
if (arg < 0.0)
|
||||
return 1;
|
||||
else if (arg == 0.0)
|
||||
{
|
||||
/* Distinguish 0.0 and -0.0. */
|
||||
static double plus_zero = 0.0;
|
||||
double arg_mem = arg;
|
||||
return (memcmp (&plus_zero, &arg_mem, SIZEOF_DBL) != 0);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
/* signbit() macro: Determine the sign bit of a floating-point number.
|
||||
Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <math.h>
|
||||
|
||||
#include <string.h>
|
||||
#include "isnanf-nolibm.h"
|
||||
#include "float+.h"
|
||||
|
||||
#ifdef gl_signbitf_OPTIMIZED_MACRO
|
||||
# undef gl_signbitf
|
||||
#endif
|
||||
|
||||
int
|
||||
gl_signbitf (float arg)
|
||||
{
|
||||
#if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT
|
||||
/* The use of a union to extract the bits of the representation of a
|
||||
'long double' is safe in practice, despite of the "aliasing rules" of
|
||||
C99, because the GCC docs say
|
||||
"Even with '-fstrict-aliasing', type-punning is allowed, provided the
|
||||
memory is accessed through the union type."
|
||||
and similarly for other compilers. */
|
||||
# define NWORDS \
|
||||
((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
|
||||
union { float value; unsigned int word[NWORDS]; } m;
|
||||
m.value = arg;
|
||||
return (m.word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1;
|
||||
#elif HAVE_COPYSIGNF_IN_LIBC
|
||||
return copysignf (1.0f, arg) < 0;
|
||||
#else
|
||||
/* This does not do the right thing for NaN, but this is irrelevant for
|
||||
most use cases. */
|
||||
if (isnanf (arg))
|
||||
return 0;
|
||||
if (arg < 0.0f)
|
||||
return 1;
|
||||
else if (arg == 0.0f)
|
||||
{
|
||||
/* Distinguish 0.0f and -0.0f. */
|
||||
static float plus_zero = 0.0f;
|
||||
float arg_mem = arg;
|
||||
return (memcmp (&plus_zero, &arg_mem, SIZEOF_FLT) != 0);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
/* signbit() macro: Determine the sign bit of a floating-point number.
|
||||
Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <math.h>
|
||||
|
||||
#include <string.h>
|
||||
#include "isnanl-nolibm.h"
|
||||
#include "float+.h"
|
||||
|
||||
#ifdef gl_signbitl_OPTIMIZED_MACRO
|
||||
# undef gl_signbitl
|
||||
#endif
|
||||
|
||||
int
|
||||
gl_signbitl (long double arg)
|
||||
{
|
||||
#if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT
|
||||
/* The use of a union to extract the bits of the representation of a
|
||||
'long double' is safe in practice, despite of the "aliasing rules" of
|
||||
C99, because the GCC docs say
|
||||
"Even with '-fstrict-aliasing', type-punning is allowed, provided the
|
||||
memory is accessed through the union type."
|
||||
and similarly for other compilers. */
|
||||
# define NWORDS \
|
||||
((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
|
||||
union { long double value; unsigned int word[NWORDS]; } m;
|
||||
m.value = arg;
|
||||
return (m.word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1;
|
||||
#elif HAVE_COPYSIGNL_IN_LIBC
|
||||
return copysignl (1.0L, arg) < 0;
|
||||
#else
|
||||
/* This does not do the right thing for NaN, but this is irrelevant for
|
||||
most use cases. */
|
||||
if (isnanl (arg))
|
||||
return 0;
|
||||
if (arg < 0.0L)
|
||||
return 1;
|
||||
else if (arg == 0.0L)
|
||||
{
|
||||
/* Distinguish 0.0L and -0.0L. */
|
||||
static long double plus_zero = 0.0L;
|
||||
long double arg_mem = arg;
|
||||
return (memcmp (&plus_zero, &arg_mem, SIZEOF_LDBL) != 0);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
/* size_max.h -- declare SIZE_MAX through system headers
|
||||
Copyright (C) 2005-2006, 2009-2023 Free Software Foundation, Inc.
|
||||
Written by Simon Josefsson.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GNULIB_SIZE_MAX_H
|
||||
#define GNULIB_SIZE_MAX_H
|
||||
|
||||
/* This file uses HAVE_STDINT_H. */
|
||||
#if !_GL_CONFIG_H_INCLUDED
|
||||
#error "Please include config.h first."
|
||||
#endif
|
||||
|
||||
/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */
|
||||
# include <limits.h>
|
||||
/* Get SIZE_MAX declaration on systems like glibc 2. */
|
||||
# if HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
# endif
|
||||
/* On systems where these include files don't define it, SIZE_MAX is defined
|
||||
in config.h. */
|
||||
|
||||
#endif /* GNULIB_SIZE_MAX_H */
|
6963
lib/vasnprintf.c
6963
lib/vasnprintf.c
File diff suppressed because it is too large
Load diff
|
@ -1,77 +0,0 @@
|
|||
/* vsprintf with automatic memory allocation.
|
||||
Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _VASNPRINTF_H
|
||||
#define _VASNPRINTF_H
|
||||
|
||||
/* This file uses _GL_ATTRIBUTE_FORMAT. */
|
||||
#if !_GL_CONFIG_H_INCLUDED
|
||||
#error "Please include config.h first."
|
||||
#endif
|
||||
|
||||
/* Get va_list. */
|
||||
#include <stdarg.h>
|
||||
|
||||
/* Get size_t. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD. */
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Write formatted output to a string dynamically allocated with malloc().
|
||||
You can pass a preallocated buffer for the result in RESULTBUF and its
|
||||
size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
|
||||
If successful, return the address of the string (this may be = RESULTBUF
|
||||
if no dynamic memory allocation was necessary) and set *LENGTHP to the
|
||||
number of resulting bytes, excluding the trailing NUL. Upon error, set
|
||||
errno and return NULL.
|
||||
|
||||
When dynamic memory allocation occurs, the preallocated buffer is left
|
||||
alone (with possibly modified contents). This makes it possible to use
|
||||
a statically allocated or stack-allocated buffer, like this:
|
||||
|
||||
char buf[100];
|
||||
size_t len = sizeof (buf);
|
||||
char *output = vasnprintf (buf, &len, format, args);
|
||||
if (output == NULL)
|
||||
... error handling ...;
|
||||
else
|
||||
{
|
||||
... use the output string ...;
|
||||
if (output != buf)
|
||||
free (output);
|
||||
}
|
||||
*/
|
||||
#if REPLACE_VASNPRINTF
|
||||
# define asnprintf rpl_asnprintf
|
||||
# define vasnprintf rpl_vasnprintf
|
||||
#endif
|
||||
extern char * asnprintf (char *restrict resultbuf, size_t *lengthp,
|
||||
const char *format, ...)
|
||||
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4));
|
||||
extern char * vasnprintf (char *restrict resultbuf, size_t *lengthp,
|
||||
const char *format, va_list args)
|
||||
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _VASNPRINTF_H */
|
|
@ -1,50 +0,0 @@
|
|||
/* Formatted output to strings.
|
||||
Copyright (C) 1999, 2002, 2006-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#ifdef IN_LIBASPRINTF
|
||||
# include "vasprintf.h"
|
||||
#else
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "vasnprintf.h"
|
||||
|
||||
int
|
||||
vasprintf (char **resultp, const char *format, va_list args)
|
||||
{
|
||||
size_t length;
|
||||
char *result = vasnprintf (NULL, &length, format, args);
|
||||
if (result == NULL)
|
||||
return -1;
|
||||
|
||||
if (length > INT_MAX)
|
||||
{
|
||||
free (result);
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
|
||||
*resultp = result;
|
||||
/* Return the number of resulting bytes, excluding the trailing NUL. */
|
||||
return length;
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/* Formatted output to a stream.
|
||||
Copyright (C) 2004, 2006-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#include <stdio.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "fseterr.h"
|
||||
#include "vasnprintf.h"
|
||||
|
||||
/* Print formatted output to the stream FP.
|
||||
Return string length of formatted string. On error, return a negative
|
||||
value. */
|
||||
int
|
||||
vfprintf (FILE *fp, const char *format, va_list args)
|
||||
{
|
||||
char buf[2000];
|
||||
char *output;
|
||||
size_t len;
|
||||
size_t lenbuf = sizeof (buf);
|
||||
|
||||
output = vasnprintf (buf, &lenbuf, format, args);
|
||||
len = lenbuf;
|
||||
|
||||
if (!output)
|
||||
{
|
||||
fseterr (fp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fwrite (output, 1, len, fp) < len)
|
||||
{
|
||||
if (output != buf)
|
||||
free (output);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (output != buf)
|
||||
free (output);
|
||||
|
||||
if (len > INT_MAX)
|
||||
{
|
||||
errno = EOVERFLOW;
|
||||
fseterr (fp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
21
lib/xsize.c
21
lib/xsize.c
|
@ -1,21 +0,0 @@
|
|||
/* Checked size_t computations.
|
||||
|
||||
Copyright (C) 2012-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#define XSIZE_INLINE _GL_EXTERN_INLINE
|
||||
#include "xsize.h"
|
110
lib/xsize.h
110
lib/xsize.h
|
@ -1,110 +0,0 @@
|
|||
/* xsize.h -- Checked size_t computations.
|
||||
|
||||
Copyright (C) 2003, 2008-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _XSIZE_H
|
||||
#define _XSIZE_H
|
||||
|
||||
/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, HAVE_STDINT_H. */
|
||||
#if !_GL_CONFIG_H_INCLUDED
|
||||
#error "Please include config.h first."
|
||||
#endif
|
||||
|
||||
/* Get size_t. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get SIZE_MAX. */
|
||||
#include <limits.h>
|
||||
#if HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/* Get ATTRIBUTE_PURE. */
|
||||
#include "attribute.h"
|
||||
|
||||
_GL_INLINE_HEADER_BEGIN
|
||||
#ifndef XSIZE_INLINE
|
||||
# define XSIZE_INLINE _GL_INLINE
|
||||
#endif
|
||||
|
||||
/* The size of memory objects is often computed through expressions of
|
||||
type size_t. Example:
|
||||
void* p = malloc (header_size + n * element_size).
|
||||
These computations can lead to overflow. When this happens, malloc()
|
||||
returns a piece of memory that is way too small, and the program then
|
||||
crashes while attempting to fill the memory.
|
||||
To avoid this, the functions and macros in this file check for overflow.
|
||||
The convention is that SIZE_MAX represents overflow.
|
||||
malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
|
||||
implementation that uses mmap --, it's recommended to use size_overflow_p()
|
||||
or size_in_bounds_p() before invoking malloc().
|
||||
The example thus becomes:
|
||||
size_t size = xsum (header_size, xtimes (n, element_size));
|
||||
void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
|
||||
*/
|
||||
|
||||
/* Convert an arbitrary value >= 0 to type size_t. */
|
||||
#define xcast_size_t(N) \
|
||||
((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
|
||||
|
||||
/* Sum of two sizes, with overflow check. */
|
||||
XSIZE_INLINE size_t ATTRIBUTE_PURE
|
||||
xsum (size_t size1, size_t size2)
|
||||
{
|
||||
size_t sum = size1 + size2;
|
||||
return (sum >= size1 ? sum : SIZE_MAX);
|
||||
}
|
||||
|
||||
/* Sum of three sizes, with overflow check. */
|
||||
XSIZE_INLINE size_t ATTRIBUTE_PURE
|
||||
xsum3 (size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
return xsum (xsum (size1, size2), size3);
|
||||
}
|
||||
|
||||
/* Sum of four sizes, with overflow check. */
|
||||
XSIZE_INLINE size_t ATTRIBUTE_PURE
|
||||
xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
|
||||
{
|
||||
return xsum (xsum (xsum (size1, size2), size3), size4);
|
||||
}
|
||||
|
||||
/* Maximum of two sizes, with overflow check. */
|
||||
XSIZE_INLINE size_t ATTRIBUTE_PURE
|
||||
xmax (size_t size1, size_t size2)
|
||||
{
|
||||
/* No explicit check is needed here, because for any n:
|
||||
max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
|
||||
return (size1 >= size2 ? size1 : size2);
|
||||
}
|
||||
|
||||
/* Multiplication of a count with an element size, with overflow check.
|
||||
The count must be >= 0 and the element size must be > 0.
|
||||
This is a macro, not a function, so that it works correctly even
|
||||
when N is of a wider type and N > SIZE_MAX. */
|
||||
#define xtimes(N, ELSIZE) \
|
||||
((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
|
||||
|
||||
/* Check for overflow. */
|
||||
#define size_overflow_p(SIZE) \
|
||||
((SIZE) == SIZE_MAX)
|
||||
/* Check against overflow. */
|
||||
#define size_in_bounds_p(SIZE) \
|
||||
((SIZE) != SIZE_MAX)
|
||||
|
||||
_GL_INLINE_HEADER_END
|
||||
|
||||
#endif /* _XSIZE_H */
|
|
@ -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'
|
||||
])
|
||||
])
|
116
m4/exponentd.m4
116
m4/exponentd.m4
|
@ -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
|
||||
])
|
|
@ -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
|
||||
])
|
112
m4/exponentl.m4
112
m4/exponentl.m4
|
@ -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
|
||||
])
|
106
m4/float_h.m4
106
m4/float_h.m4
|
@ -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])
|
||||
])
|
181
m4/frexp.m4
181
m4/frexp.m4
|
@ -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
|
||||
])
|
||||
])
|
||||
])
|
233
m4/frexpl.m4
233
m4/frexpl.m4
|
@ -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
|
||||
])
|
||||
])
|
||||
])
|
|
@ -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>
|
||||
]])
|
||||
])
|
|
@ -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
|
||||
])
|
||||
|
|
|
@ -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
|
||||
])
|
|
@ -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
|
||||
])
|
96
m4/isnand.m4
96
m4/isnand.m4
|
@ -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])
|
||||
])
|
||||
])
|
197
m4/isnanf.m4
197
m4/isnanf.m4
|
@ -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
|
||||
])
|
||||
])
|
||||
])
|
248
m4/isnanl.m4
248
m4/isnanl.m4
|
@ -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
|
||||
])
|
||||
])
|
||||
])
|
135
m4/ldexpl.m4
135
m4/ldexpl.m4
|
@ -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
|
||||
])
|
||||
])
|
||||
])
|
391
m4/math_h.m4
391
m4/math_h.m4
|
@ -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])
|
||||
])
|
|
@ -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
|
||||
])
|
|
@ -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
|
||||
])
|
|
@ -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], [:])
|
2158
m4/printf.m4
2158
m4/printf.m4
File diff suppressed because it is too large
Load diff
393
m4/signbit.m4
393
m4/signbit.m4
|
@ -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;
|
||||
}
|
||||
]])
|
|
@ -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])
|
||||
])
|
|
@ -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
|
||||
])
|
462
m4/vasnprintf.m4
462
m4/vasnprintf.m4
|
@ -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],
|
||||
[
|
||||
])
|
|
@ -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
|
||||
])
|
|
@ -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],
|
||||
[
|
||||
])
|
|
@ -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], [:])
|
12
m4/xsize.m4
12
m4/xsize.m4
|
@ -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])
|
||||
])
|
|
@ -436,7 +436,6 @@ s/= @GL_GENERATE_STDDEF_H_CONDITION@/= 1/
|
|||
s/= @GL_GENERATE_STDINT_H_CONDITION@/= 1/
|
||||
s/= @GL_GENERATE_LIMITS_H_CONDITION@/= 1/
|
||||
s/= @GL_GENERATE_ERRNO_H_CONDITION@/= /
|
||||
s/= @GL_GENERATE_FLOAT_H_CONDITION@/= /
|
||||
s/= @GL_GENERATE_GETOPT_CDEFS_H_CONDITION@/= 1/
|
||||
s/= @GL_GENERATE_GETOPT_H_CONDITION@/= 1/
|
||||
s/= @GL_GENERATE_GMP_H_CONDITION@/= 1/
|
||||
|
@ -464,7 +463,6 @@ OMIT_GNULIB_MODULE_euidaccess = true\
|
|||
OMIT_GNULIB_MODULE_faccessat = true\
|
||||
OMIT_GNULIB_MODULE_fcntl = true\
|
||||
OMIT_GNULIB_MODULE_fdopendir = true\
|
||||
OMIT_GNULIB_MODULE_float = true\
|
||||
OMIT_GNULIB_MODULE_fstatat = true\
|
||||
OMIT_GNULIB_MODULE_fsync = true\
|
||||
OMIT_GNULIB_MODULE_getline = true\
|
||||
|
@ -480,8 +478,6 @@ OMIT_GNULIB_MODULE_math = true\
|
|||
OMIT_GNULIB_MODULE_nanosleep = true\
|
||||
OMIT_GNULIB_MODULE_open = true\
|
||||
OMIT_GNULIB_MODULE_pipe2 = true\
|
||||
OMIT_GNULIB_MODULE_printf-posix = true\
|
||||
OMIT_GNULIB_MODULE_printf-frexpl = true\
|
||||
OMIT_GNULIB_MODULE_pselect = true\
|
||||
OMIT_GNULIB_MODULE_putenv = true\
|
||||
OMIT_GNULIB_MODULE_qcopy-acl = true\
|
||||
|
@ -494,7 +490,6 @@ OMIT_GNULIB_MODULE_symlink = true\
|
|||
OMIT_GNULIB_MODULE_sys_select = true\
|
||||
OMIT_GNULIB_MODULE_sys_time = true\
|
||||
OMIT_GNULIB_MODULE_crypto\/md5 = true\
|
||||
OMIT_GNULIB_MODULE_vprintf-posix = true
|
||||
/^arg-nonnull\.h:/,/^[ ][ ]*mv /c\
|
||||
arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h\
|
||||
sed -n -e '/GL_ARG_NONNULL/,$$p' < $(top_srcdir)/build-aux/snippet/arg-nonnull.h > $@
|
||||
|
|
Loading…
Add table
Reference in a new issue