1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

Assume 'long double' exists.

This commit is contained in:
Bruno Haible
2007-04-06 14:36:56 +00:00
parent 411cc9cd04
commit 9f88c0b0e0
38 changed files with 214 additions and 339 deletions

View File

@@ -1,3 +1,52 @@
2007-04-06 Bruno Haible <bruno@clisp.org>
Assume the 'long double' type.
* m4/longdouble.m4: Remove file.
* config/srclist.txt: Don't mention longdouble.m4.
* lib/allocsa.h: Assume HAVE_LONG_DOUBLE to be true.
* lib/float+.h: Likewise.
* lib/frexp.c: Likewise.
* lib/printf-args.h: Likewise.
* lib/printf-args.c: Likewise.
* lib/printf-frexp.c: Likewise.
* lib/printf-parse.c: Likewise.
* lib/vasnprintf.c: Likewise.
* m4/allocsa.m4: Remove gt_TYPE_LONGDOUBLE invocation.
* m4/intl.m4: Likewise.
* m4/isnanl.m4: Likewise.
* m4/printf.m4: Likewise.
* m4/printf-frexpl.m4: Likewise.
* m4/vasnprintf.m4: Likewise.
* modules/allocsa (Files): Remove m4/longdouble.m4.
* modules/gettext (Files): Likewise.
* modules/relocatable-prog-wrapper (Files): Likewise.
* modules/vasnprintf (Files): Likewise.
* modules/isnanl (Files): Likewise.
(Include): Simplify.
* modules/isnanl-nolibm (Files): Remove m4/longdouble.m4.
(Include): Simplify.
* modules/printf-frexpl (Files): Remove m4/longdouble.m4.
(Include): Simplify.
* modules/snprintf-posix-tests (Files): Remove m4/longdouble.m4.
(configure.ac): Remove gt_TYPE_LONGDOUBLE invocation.
* modules/sprintf-posix-tests (Files): Remove m4/longdouble.m4.
(configure.ac): Remove gt_TYPE_LONGDOUBLE invocation.
* modules/vasnprintf-posix-tests (Files): Remove m4/longdouble.m4.
(configure.ac): Remove gt_TYPE_LONGDOUBLE invocation.
* modules/vasprintf-posix-tests (Files): Remove m4/longdouble.m4.
(configure.ac): Remove gt_TYPE_LONGDOUBLE invocation.
* modules/vsnprintf-posix-tests (Files): Remove m4/longdouble.m4.
(configure.ac): Remove gt_TYPE_LONGDOUBLE invocation.
* modules/vsprintf-posix-tests (Files): Remove m4/longdouble.m4.
(configure.ac): Remove gt_TYPE_LONGDOUBLE invocation.
* tests/test-isnanl-nolibm.c: Assume HAVE_LONG_DOUBLE to be true.
* tests/test-isnanl.c: Likewise.
* tests/test-snprintf-posix.h: Likewise.
* tests/test-sprintf-posix.h: Likewise.
* tests/test-vasnprintf-posix.c: Likewise.
* tests/test-vasnprintf-posix2.c: Likewise.
* tests/test-vasprintf-posix.c: Likewise.
2007-04-06 Bruno Haible <bruno@clisp.org>
Fix problem with Compaq (ex-DEC) Desktop C compiler on Tru64.

4
NEWS
View File

@@ -6,6 +6,10 @@ User visible incompatible changes
Date Modules Changes
2007-04-06 gettext The macro HAVE_LONG_DOUBLE is no longer set.
You can replace all its uses with 1, i.e. assume
'long double' as a type exists.
2007-04-01 arcfour Renamed to crypto/arcfour.
arctwo Renamed to crypto/arctwo.
des Renamed to crypto/des.

View File

@@ -1,4 +1,4 @@
# $Id: srclist.txt,v 1.147 2007-04-02 22:38:14 karl Exp $
# $Id: srclist.txt,v 1.148 2007-04-06 14:36:56 haible Exp $
# Files for which we are not the source. See ./srclistvars.sh for the
# variable definitions.
@@ -79,7 +79,6 @@ $GETTEXT/gettext-runtime/m4/intldir.m4 m4
$GETTEXT/gettext-runtime/m4/intmax.m4 m4
$GETTEXT/gettext-runtime/m4/inttypes-pri.m4 m4
$GETTEXT/gettext-runtime/m4/lcmessage.m4 m4
$GETTEXT/gettext-runtime/m4/longdouble.m4 m4
$GETTEXT/gettext-runtime/m4/nls.m4 m4
$GETTEXT/gettext-runtime/m4/po.m4 m4
$GETTEXT/gettext-runtime/m4/printf-posix.m4 m4

View File

@@ -109,16 +109,12 @@ enum
#if HAVE_LONG_LONG_INT
sa_alignment_longlong = sa_alignof (long long),
#endif
#if HAVE_LONG_DOUBLE
sa_alignment_longdouble = sa_alignof (long double),
#endif
sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
#if HAVE_LONG_LONG_INT
| (sa_alignment_longlong - 1)
#endif
#if HAVE_LONG_DOUBLE
| (sa_alignment_longdouble - 1)
#endif
) + 1,
/* The increment that guarantees room for a magic word must be >= sizeof (int)
and a multiple of sa_alignment_max. */

View File

@@ -143,8 +143,6 @@
/* Verify that SIZEOF_FLT <= sizeof (float) etc. */
typedef int verify_sizeof_flt[2 * (SIZEOF_FLT <= sizeof (float)) - 1];
typedef int verify_sizeof_dbl[2 * (SIZEOF_DBL <= sizeof (double)) - 1];
#if HAVE_LONG_DOUBLE
typedef int verify_sizeof_ldbl[2 * (SIZEOF_LDBL <= sizeof (long double)) - 1];
#endif
#endif /* _FLOATPLUS_H */

View File

@@ -20,40 +20,38 @@
#include <config.h>
#if !(defined USE_LONG_DOUBLE && !HAVE_LONG_DOUBLE)
/* Specification. */
# include <math.h>
#include <math.h>
# include <float.h>
# ifdef USE_LONG_DOUBLE
# include "isnanl-nolibm.h"
# include "fpucw.h"
# else
# include "isnan.h"
# endif
#include <float.h>
#ifdef USE_LONG_DOUBLE
# include "isnanl-nolibm.h"
# include "fpucw.h"
#else
# include "isnan.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 isnan
# define DECL_ROUNDING
# define BEGIN_ROUNDING()
# define END_ROUNDING()
# define L_(literal) literal
# endif
#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 isnan
# define DECL_ROUNDING
# define BEGIN_ROUNDING()
# define END_ROUNDING()
# define L_(literal) literal
#endif
DOUBLE
FUNC (DOUBLE x, int *exp)
@@ -167,11 +165,3 @@ FUNC (DOUBLE x, int *exp)
*exp = exponent;
return x;
}
#else
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
typedef int dummy;
#endif

View File

@@ -67,11 +67,9 @@ printf_fetchargs (va_list args, arguments *a)
case TYPE_DOUBLE:
ap->a.a_double = va_arg (args, double);
break;
#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
ap->a.a_longdouble = va_arg (args, long double);
break;
#endif
case TYPE_CHAR:
ap->a.a_char = va_arg (args, int);
break;

View File

@@ -52,9 +52,7 @@ typedef enum
TYPE_ULONGLONGINT,
#endif
TYPE_DOUBLE,
#if HAVE_LONG_DOUBLE
TYPE_LONGDOUBLE,
#endif
TYPE_CHAR,
#if HAVE_WINT_T
TYPE_WIDE_CHAR,
@@ -93,9 +91,7 @@ typedef struct
#endif
float a_float;
double a_double;
#if HAVE_LONG_DOUBLE
long double a_longdouble;
#endif
int a_char;
#if HAVE_WINT_T
wint_t a_wide_char;

View File

@@ -17,52 +17,50 @@
#include <config.h>
#if !(defined USE_LONG_DOUBLE && !HAVE_LONG_DOUBLE)
/* Specification. */
# ifdef USE_LONG_DOUBLE
# include "printf-frexpl.h"
# else
# include "printf-frexp.h"
# endif
#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
#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
#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 *exp)
@@ -72,7 +70,7 @@ FUNC (DOUBLE x, int *exp)
BEGIN_ROUNDING ();
# ifdef USE_FREXP_LDEXP
#ifdef USE_FREXP_LDEXP
/* frexp and ldexp are usually faster than the loop below. */
x = FREXP (x, &exponent);
@@ -84,7 +82,7 @@ FUNC (DOUBLE x, int *exp)
x = LDEXP (x, exponent - (MIN_EXP - 1));
exponent = MIN_EXP - 1;
}
# else
#else
{
/* Since the exponent is an 'int', it fits in 64 bits. Therefore the
loops are executed no more than 64 times. */
@@ -182,18 +180,10 @@ FUNC (DOUBLE x, int *exp)
/* Here either x < 1.0 and exponent = MIN_EXP - 1,
or 1.0 <= x < 2.0 and exponent >= MIN_EXP - 1. */
}
# endif
#endif
END_ROUNDING ();
*exp = exponent;
return x;
}
#else
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
typedef int dummy;
#endif

View File

@@ -421,12 +421,10 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
break;
case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
case 'a': case 'A':
#if HAVE_LONG_DOUBLE
if (flags >= 16 || (flags & 4))
type = TYPE_LONGDOUBLE;
else
#endif
type = TYPE_DOUBLE;
type = TYPE_DOUBLE;
break;
case 'c':
if (flags >= 8)

View File

@@ -57,11 +57,9 @@
# include "float+.h"
# include "isnan.h"
# include "printf-frexp.h"
# if HAVE_LONG_DOUBLE
# include "isnanl-nolibm.h"
# include "printf-frexpl.h"
# include "fpucw.h"
# endif
# include "isnanl-nolibm.h"
# include "printf-frexpl.h"
# include "fpucw.h"
#endif
/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
@@ -386,7 +384,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
}
/* Allocate a temporary buffer of sufficient size. */
# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
tmp_length =
(unsigned int) ((LDBL_DIG + 1)
@@ -394,7 +391,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
)
+ 1; /* turn floor into ceil */
else
# endif
tmp_length =
(unsigned int) ((DBL_DIG + 1)
* 0.831 /* decimal -> hexadecimal */
@@ -427,7 +423,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
pad_ptr = NULL;
p = tmp;
# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
{
long double arg = a.arg[dp->arg_index].a.a_longdouble;
@@ -560,15 +555,15 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
}
}
*p++ = dp->conversion - 'A' + 'P';
# if WIDE_CHAR_VERSION
# if WIDE_CHAR_VERSION
{
static const wchar_t decimal_format[] =
{ '%', '+', 'd', '\0' };
SNPRINTF (p, 6 + 1, decimal_format, exponent);
}
# else
# else
sprintf (p, "%+d", exponent);
# endif
# endif
while (*p != '\0')
p++;
}
@@ -577,7 +572,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
}
}
else
# endif
{
double arg = a.arg[dp->arg_index].a.a_double;
@@ -932,7 +926,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
break;
case 'f': case 'F':
# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
tmp_length =
(unsigned int) (LDBL_MAX_EXP
@@ -942,7 +935,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
+ 1 /* turn floor into ceil */
+ 10; /* sign, decimal point etc. */
else
# endif
tmp_length =
(unsigned int) (DBL_MAX_EXP
* 0.30103 /* binary -> decimal */
@@ -960,7 +952,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
break;
case 'a': case 'A':
# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
tmp_length =
(unsigned int) (LDBL_DIG
@@ -968,7 +959,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
)
+ 1; /* turn floor into ceil */
else
# endif
tmp_length =
(unsigned int) (DBL_DIG
* 0.831 /* decimal -> hexadecimal */
@@ -1087,11 +1077,9 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
#endif
*p++ = 'l';
break;
#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
*p++ = 'L';
break;
#endif
default:
break;
}
@@ -1248,14 +1236,12 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
SNPRINTF_BUF (arg);
}
break;
#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
{
long double arg = a.arg[dp->arg_index].a.a_longdouble;
SNPRINTF_BUF (arg);
}
break;
#endif
case TYPE_CHAR:
{
int arg = a.arg[dp->arg_index].a.a_char;

View File

@@ -1,5 +1,5 @@
# allocsa.m4 serial 6
dnl Copyright (C) 2003-2004, 2006 Free Software Foundation, Inc.
# allocsa.m4 serial 7
dnl Copyright (C) 2003-2004, 2006-2007 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.
@@ -11,5 +11,4 @@ AC_DEFUN([gl_ALLOCSA],
dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies.
AC_REQUIRE([gl_EEMALLOC])
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
])

View File

@@ -1,5 +1,5 @@
# intl.m4 serial 3 (gettext-0.16)
dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
# intl.m4 serial 4 (gettext-0.16.2)
dnl Copyright (C) 1995-2007 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.
@@ -33,7 +33,6 @@ AC_DEFUN([AM_INTL_SUBDIR],
AC_REQUIRE([gl_VISIBILITY])dnl
AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
AC_REQUIRE([gt_TYPE_WINT_T])dnl
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])

View File

@@ -1,4 +1,4 @@
# isnanl.m4 serial 2
# isnanl.m4 serial 3
dnl Copyright (C) 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,60 +6,54 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_ISNANL],
[
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
ISNANL_LIBM=
if test $gt_cv_c_long_double = yes; then
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
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
AC_DEFINE([HAVE_ISNANL], 1,
[Define if the isnan(long double) function is available.])
else
AC_LIBOBJ([isnanl])
gl_LONG_DOUBLE_EXPONENT_LOCATION
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
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
AC_DEFINE([HAVE_ISNANL], 1,
[Define if the isnan(long double) function is available.])
else
AC_LIBOBJ([isnanl])
gl_LONG_DOUBLE_EXPONENT_LOCATION
fi
AC_SUBST([ISNANL_LIBM])
])
AC_DEFUN([gl_FUNC_ISNANL_NO_LIBM],
[
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
if test $gt_cv_c_long_double = yes; then
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.])
else
AC_LIBOBJ([isnanl])
gl_LONG_DOUBLE_EXPONENT_LOCATION
fi
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.])
else
AC_LIBOBJ([isnanl])
gl_LONG_DOUBLE_EXPONENT_LOCATION
fi
])
@@ -107,7 +101,6 @@ dnl infinite. This test fails e.g. on NetBSD/i386.
AC_DEFUN([gl_FUNC_ISNANL_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether isnanl works], [gl_cv_func_isnanl_works],
[

View File

@@ -1,31 +0,0 @@
# longdouble.m4 serial 2 (gettext-0.15)
dnl Copyright (C) 2002-2003, 2006 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.
dnl Test whether the compiler supports the 'long double' type.
dnl Prerequisite: AC_PROG_CC
dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf
dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
AC_DEFUN([gt_TYPE_LONGDOUBLE],
[
AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
[if test "$GCC" = yes; then
gt_cv_c_long_double=yes
else
AC_TRY_COMPILE([
/* The Stardent Vistra knows sizeof(long double), but does not support it. */
long double foo = 0.0;
/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
int array [2*(sizeof(long double) >= sizeof(double)) - 1];
], ,
gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
fi])
if test $gt_cv_c_long_double = yes; then
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
fi
])

View File

@@ -1,4 +1,4 @@
# printf-frexpl.m4 serial 3
# printf-frexpl.m4 serial 4
dnl Copyright (C) 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,48 +8,45 @@ dnl Check how to define printf_frexpl() without linking with libm.
AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
[
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gl_MATH_H_DEFAULTS])
if test $gt_cv_c_long_double = yes; then
AC_CACHE_CHECK([whether frexpl can be used without linking with libm],
[gl_cv_func_frexpl_no_libm],
[
AC_TRY_LINK([#include <math.h>
long double x;
int y;],
[return frexpl (x, &y) < 1;],
[gl_cv_func_frexpl_no_libm=yes],
[gl_cv_func_frexpl_no_libm=no])
])
if test $gl_cv_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 MacOS 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
AC_CACHE_CHECK([whether frexpl can be used without linking with libm],
[gl_cv_func_frexpl_no_libm],
[
AC_TRY_LINK([#include <math.h>
long double x;
int y;],
[return frexpl (x, &y) < 1;],
[gl_cv_func_frexpl_no_libm=yes],
[gl_cv_func_frexpl_no_libm=no])
])
if test $gl_cv_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 MacOS 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
AC_CACHE_CHECK([whether ldexpl can be used without linking with libm],
[gl_cv_func_ldexpl_no_libm],
[
AC_TRY_LINK([#include <math.h>
long double x;
int y;],
[return ldexpl (x, y) < 1;],
[gl_cv_func_ldexpl_no_libm=yes],
[gl_cv_func_ldexpl_no_libm=no])
])
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 MacOS 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
AC_CACHE_CHECK([whether ldexpl can be used without linking with libm],
[gl_cv_func_ldexpl_no_libm],
[
AC_TRY_LINK([#include <math.h>
long double x;
int y;],
[return ldexpl (x, y) < 1;],
[gl_cv_func_ldexpl_no_libm=yes],
[gl_cv_func_ldexpl_no_libm=no])
])
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 MacOS 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
])

View File

@@ -1,4 +1,4 @@
# printf.m4 serial 3
# printf.m4 serial 4
dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,6 @@ AC_DEFUN([gl_PRINTF_SIZES_C99],
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
[gl_cv_func_printf_sizes_c99],
@@ -46,12 +45,10 @@ int main ()
if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
|| strcmp (buf, "12345673 33") != 0)
return 1;
#if HAVE_LONG_DOUBLE
buf[0] = '\0';
if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
|| strcmp (buf, "1.5 33") != 0)
return 1;
#endif
return 0;
}], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no],
[
@@ -92,7 +89,6 @@ dnl Result is gl_cv_func_printf_directive_a.
AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
[gl_cv_func_printf_directive_a],
@@ -129,7 +125,6 @@ int main ()
&& strcmp (buf, "0x4.0p-1") != 0
&& strcmp (buf, "0x8.0p-2") != 0))
return 1;
#if HAVE_LONG_DOUBLE
/* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
if (sprintf (buf, "%.1La", 1.999L) < 0
@@ -138,7 +133,6 @@ int main ()
&& strcmp (buf, "0x4.0p-1") != 0
&& strcmp (buf, "0x8.0p-2") != 0))
return 1;
#endif
return 0;
}], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no],
[

View File

@@ -1,4 +1,4 @@
# vasnprintf.m4 serial 11
# vasnprintf.m4 serial 12
dnl Copyright (C) 2002-2004, 2006-2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -34,7 +34,6 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
])
@@ -43,7 +42,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_REQUIRE([AC_TYPE_SIZE_T])
@@ -56,7 +54,6 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_CHECK_FUNCS(snprintf wcslen)

View File

@@ -8,7 +8,6 @@ lib/allocsa.valgrind
m4/allocsa.m4
m4/eealloc.m4
m4/longlong.m4
m4/longdouble.m4
Depends-on:
alloca-opt

View File

@@ -15,7 +15,6 @@ m4/inttypes_h.m4
m4/inttypes-pri.m4
m4/lcmessage.m4
m4/lock.m4
m4/longdouble.m4
m4/longlong.m4
m4/nls.m4
m4/po.m4

View File

@@ -7,7 +7,6 @@ lib/isnanl.c
lib/isnan.c
lib/float+.h
m4/isnanl.m4
m4/longdouble.m4
Depends-on:
fpieee
@@ -18,9 +17,7 @@ gl_FUNC_ISNANL
Makefile.am:
Include:
#if HAVE_LONG_DOUBLE
# include "isnanl.h"
#endif
"isnanl.h"
Link:
$(ISNANL_LIBM)

View File

@@ -7,7 +7,6 @@ lib/isnanl.c
lib/isnan.c
lib/float+.h
m4/isnanl.m4
m4/longdouble.m4
Depends-on:
fpieee
@@ -18,9 +17,7 @@ gl_FUNC_ISNANL_NO_LIBM
Makefile.am:
Include:
#if HAVE_LONG_DOUBLE
# include "isnanl-nolibm.h"
#endif
"isnanl-nolibm.h"
License:
LGPL

View File

@@ -8,7 +8,6 @@ lib/printf-frexpl.c
lib/printf-frexp.c
m4/printf-frexpl.m4
m4/ldexpl.m4
m4/longdouble.m4
Depends-on:
math
@@ -21,9 +20,7 @@ Makefile.am:
lib_SOURCES += printf-frexpl.c
Include:
#if HAVE_LONG_DOUBLE
# include "printf-frexpl.h"
#endif
"printf-frexpl.h"
License:
LGPL

View File

@@ -26,7 +26,6 @@ m4/allocsa.m4
m4/canonicalize-lgpl.m4
m4/eealloc.m4
m4/longlong.m4
m4/longdouble.m4
m4/readlink.m4
m4/relocatable-lib.m4
m4/setenv.m4

View File

@@ -1,13 +1,11 @@
Files:
tests/test-snprintf-posix.c
tests/test-snprintf-posix.h
m4/longdouble.m4
Depends-on:
stdint
configure.ac:
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
Makefile.am:
TESTS += test-snprintf-posix

View File

@@ -1,13 +1,11 @@
Files:
tests/test-sprintf-posix.c
tests/test-sprintf-posix.h
m4/longdouble.m4
Depends-on:
stdint
configure.ac:
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
Makefile.am:
TESTS += test-sprintf-posix

View File

@@ -10,7 +10,6 @@ lib/float+.h
lib/vasnprintf.h
lib/vasnprintf.c
lib/asnprintf.c
m4/longdouble.m4
m4/wchar_t.m4
m4/wint_t.m4
m4/longlong.m4

View File

@@ -2,14 +2,12 @@ Files:
tests/test-vasnprintf-posix.c
tests/test-vasnprintf-posix2.sh
tests/test-vasnprintf-posix2.c
m4/longdouble.m4
m4/locale-fr.m4
Depends-on:
stdint
configure.ac:
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
gt_LOCALE_FR
gt_LOCALE_FR_UTF8

View File

@@ -1,12 +1,10 @@
Files:
tests/test-vasprintf-posix.c
m4/longdouble.m4
Depends-on:
stdint
configure.ac:
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
Makefile.am:
TESTS += test-vasprintf-posix

View File

@@ -1,13 +1,11 @@
Files:
tests/test-vsnprintf-posix.c
tests/test-snprintf-posix.h
m4/longdouble.m4
Depends-on:
stdint
configure.ac:
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
Makefile.am:
TESTS += test-vsnprintf-posix

View File

@@ -1,13 +1,11 @@
Files:
tests/test-vsprintf-posix.c
tests/test-sprintf-posix.h
m4/longdouble.m4
Depends-on:
stdint
configure.ac:
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
Makefile.am:
TESTS += test-vsprintf-posix

View File

@@ -19,18 +19,6 @@
#include <config.h>
#if HAVE_LONG_DOUBLE
#include "isnanl-nolibm.h"
#include "test-isnanl.h"
#else
int
main ()
{
return 0;
}
#endif

View File

@@ -19,18 +19,6 @@
#include <config.h>
#if HAVE_LONG_DOUBLE
#include "isnanl.h"
#include "test-isnanl.h"
#else
int
main ()
{
return 0;
}
#endif

View File

@@ -85,7 +85,6 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
ASSERT (retval == strlen (result));
}
#if HAVE_LONG_DOUBLE
{
char result[100];
int retval =
@@ -93,7 +92,6 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
ASSERT (strcmp (result, "1.5 33") == 0);
ASSERT (retval == strlen (result));
}
#endif
/* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
output of floating-point numbers. */
@@ -355,8 +353,6 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
ASSERT (retval == strlen (result));
}
#if HAVE_LONG_DOUBLE
{ /* A positive number. */
char result[100];
int retval =
@@ -615,8 +611,6 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
ASSERT (retval == strlen (result));
}
#endif
/* Test the support of the %n format directive. */
{

View File

@@ -71,7 +71,6 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
ASSERT (retval == strlen (result));
}
#if HAVE_LONG_DOUBLE
{
char result[1000];
int retval =
@@ -79,7 +78,6 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
ASSERT (strcmp (result, "1.5 33") == 0);
ASSERT (retval == strlen (result));
}
#endif
/* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
output of floating-point numbers. */
@@ -341,8 +339,6 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
ASSERT (retval == strlen (result));
}
#if HAVE_LONG_DOUBLE
{ /* A positive number. */
char result[1000];
int retval =
@@ -601,8 +597,6 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
ASSERT (retval == strlen (result));
}
#endif
/* Test the support of the %n format directive. */
{

View File

@@ -111,7 +111,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
free (result);
}
#if HAVE_LONG_DOUBLE
{
size_t length;
char *result =
@@ -121,7 +120,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
ASSERT (length == strlen (result));
free (result);
}
#endif
/* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
output of floating-point numbers. */
@@ -433,8 +431,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
free (result);
}
#if HAVE_LONG_DOUBLE
{ /* A positive number. */
size_t length;
char *result =
@@ -743,8 +739,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
free (result);
}
#endif
/* Test the support of the %n format directive. */
{

View File

@@ -49,8 +49,6 @@ main (int argc, char *argv[])
free (result);
}
#if HAVE_LONG_DOUBLE
/* Test that a locale dependent decimal point is used. */
{
size_t length;
@@ -64,7 +62,5 @@ main (int argc, char *argv[])
free (result);
}
#endif
return 0;
}

View File

@@ -92,7 +92,6 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
free (result);
}
#if HAVE_LONG_DOUBLE
{
char *result;
int retval =
@@ -102,7 +101,6 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
ASSERT (retval == strlen (result));
free (result);
}
#endif
/* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
output of floating-point numbers. */
@@ -414,8 +412,6 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
free (result);
}
#if HAVE_LONG_DOUBLE
{ /* A positive number. */
char *result;
int retval =
@@ -724,8 +720,6 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
free (result);
}
#endif
/* Test the support of the %n format directive. */
{