changeset 8648:359d135f748c

Assume 'long double' exists.
author Bruno Haible <bruno@clisp.org>
date Fri, 06 Apr 2007 14:36:56 +0000
parents 8493230fff95
children ca75eb69fcf4
files ChangeLog NEWS config/srclist.txt lib/allocsa.h lib/float+.h lib/frexp.c lib/printf-args.c lib/printf-args.h lib/printf-frexp.c lib/printf-parse.c lib/vasnprintf.c m4/allocsa.m4 m4/intl.m4 m4/isnanl.m4 m4/longdouble.m4 m4/printf-frexpl.m4 m4/printf.m4 m4/vasnprintf.m4 modules/allocsa modules/gettext modules/isnanl modules/isnanl-nolibm modules/printf-frexpl modules/relocatable-prog-wrapper modules/snprintf-posix-tests modules/sprintf-posix-tests modules/vasnprintf modules/vasnprintf-posix-tests modules/vasprintf-posix-tests modules/vsnprintf-posix-tests modules/vsprintf-posix-tests tests/test-isnanl-nolibm.c tests/test-isnanl.c tests/test-snprintf-posix.h tests/test-sprintf-posix.h tests/test-vasnprintf-posix.c tests/test-vasnprintf-posix2.c tests/test-vasprintf-posix.c
diffstat 38 files changed, 215 insertions(+), 340 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,10 @@
 
 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.
--- a/config/srclist.txt
+++ b/config/srclist.txt
@@ -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/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
--- a/lib/allocsa.h
+++ b/lib/allocsa.h
@@ -109,16 +109,12 @@
 #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.  */
--- a/lib/float+.h
+++ b/lib/float+.h
@@ -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 */
--- a/lib/frexp.c
+++ b/lib/frexp.c
@@ -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 @@
   *exp = exponent;
   return x;
 }
-
-#else
-
-/* This declaration is solely to ensure that after preprocessing
-   this file is never empty.  */
-typedef int dummy;
-
-#endif
--- a/lib/printf-args.c
+++ b/lib/printf-args.c
@@ -67,11 +67,9 @@
       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;
--- a/lib/printf-args.h
+++ b/lib/printf-args.h
@@ -52,9 +52,7 @@
   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 @@
 #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;
--- a/lib/printf-frexp.c
+++ b/lib/printf-frexp.c
@@ -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
 
-/* 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
+#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 @@
 
   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 @@
       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 @@
     /* 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
--- a/lib/printf-parse.c
+++ b/lib/printf-parse.c
@@ -421,12 +421,10 @@
 		  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)
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -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 @@
 		  }
 
 		/* 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 @@
 				   )
 		    + 1; /* turn floor into ceil */
 		else
-# endif
 		  tmp_length =
 		    (unsigned int) ((DBL_DIG + 1)
 				    * 0.831 /* decimal -> hexadecimal */
@@ -427,7 +423,6 @@
 
 		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 @@
 				}
 			      }
 			      *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 @@
 		      }
 		  }
 		else
-# endif
 		  {
 		    double arg = a.arg[dp->arg_index].a.a_double;
 
@@ -932,7 +926,6 @@
 		      break;
 
 		    case 'f': case 'F':
-# if HAVE_LONG_DOUBLE
 		      if (type == TYPE_LONGDOUBLE)
 			tmp_length =
 			  (unsigned int) (LDBL_MAX_EXP
@@ -942,7 +935,6 @@
 			  + 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 @@
 		      break;
 
 		    case 'a': case 'A':
-# if HAVE_LONG_DOUBLE
 		      if (type == TYPE_LONGDOUBLE)
 			tmp_length =
 			  (unsigned int) (LDBL_DIG
@@ -968,7 +959,6 @@
 					 )
 			  + 1; /* turn floor into ceil */
 		      else
-# endif
 			tmp_length =
 			  (unsigned int) (DBL_DIG
 					  * 0.831 /* decimal -> hexadecimal */
@@ -1087,11 +1077,9 @@
 #endif
 		    *p++ = 'l';
 		    break;
-#if HAVE_LONG_DOUBLE
 		  case TYPE_LONGDOUBLE:
 		    *p++ = 'L';
 		    break;
-#endif
 		  default:
 		    break;
 		  }
@@ -1248,14 +1236,12 @@
 			  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;
--- a/m4/allocsa.m4
+++ b/m4/allocsa.m4
@@ -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 @@
   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])
 ])
--- a/m4/intl.m4
+++ b/m4/intl.m4
@@ -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_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])
--- a/m4/isnanl.m4
+++ b/m4/isnanl.m4
@@ -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 @@
 
 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
+  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
-    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
+  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 @@
 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],
     [
deleted file mode 100644
--- a/m4/longdouble.m4
+++ /dev/null
@@ -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
-])
--- a/m4/printf-frexpl.m4
+++ b/m4/printf-frexpl.m4
@@ -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 @@
 
 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
 ])
--- a/m4/printf.m4
+++ b/m4/printf.m4
@@ -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_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 @@
   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 @@
 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 @@
           && 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 @@
           && 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],
       [
--- a/m4/vasnprintf.m4
+++ b/m4/vasnprintf.m4
@@ -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_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_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_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)
--- a/modules/allocsa
+++ b/modules/allocsa
@@ -8,7 +8,6 @@
 m4/allocsa.m4
 m4/eealloc.m4
 m4/longlong.m4
-m4/longdouble.m4
 
 Depends-on:
 alloca-opt
--- a/modules/gettext
+++ b/modules/gettext
@@ -15,7 +15,6 @@
 m4/inttypes-pri.m4
 m4/lcmessage.m4
 m4/lock.m4
-m4/longdouble.m4
 m4/longlong.m4
 m4/nls.m4
 m4/po.m4
--- a/modules/isnanl
+++ b/modules/isnanl
@@ -7,7 +7,6 @@
 lib/isnan.c
 lib/float+.h
 m4/isnanl.m4
-m4/longdouble.m4
 
 Depends-on:
 fpieee
@@ -18,9 +17,7 @@
 Makefile.am:
 
 Include:
-#if HAVE_LONG_DOUBLE
-# include "isnanl.h"
-#endif
+"isnanl.h"
 
 Link:
 $(ISNANL_LIBM)
--- a/modules/isnanl-nolibm
+++ b/modules/isnanl-nolibm
@@ -7,7 +7,6 @@
 lib/isnan.c
 lib/float+.h
 m4/isnanl.m4
-m4/longdouble.m4
 
 Depends-on:
 fpieee
@@ -18,9 +17,7 @@
 Makefile.am:
 
 Include:
-#if HAVE_LONG_DOUBLE
-# include "isnanl-nolibm.h"
-#endif
+"isnanl-nolibm.h"
 
 License:
 LGPL
--- a/modules/printf-frexpl
+++ b/modules/printf-frexpl
@@ -8,7 +8,6 @@
 lib/printf-frexp.c
 m4/printf-frexpl.m4
 m4/ldexpl.m4
-m4/longdouble.m4
 
 Depends-on:
 math
@@ -21,9 +20,7 @@
 lib_SOURCES += printf-frexpl.c
 
 Include:
-#if HAVE_LONG_DOUBLE
-# include "printf-frexpl.h"
-#endif
+"printf-frexpl.h"
 
 License:
 LGPL
--- a/modules/relocatable-prog-wrapper
+++ b/modules/relocatable-prog-wrapper
@@ -26,7 +26,6 @@
 m4/canonicalize-lgpl.m4
 m4/eealloc.m4
 m4/longlong.m4
-m4/longdouble.m4
 m4/readlink.m4
 m4/relocatable-lib.m4
 m4/setenv.m4
--- a/modules/snprintf-posix-tests
+++ b/modules/snprintf-posix-tests
@@ -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
--- a/modules/sprintf-posix-tests
+++ b/modules/sprintf-posix-tests
@@ -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
--- a/modules/vasnprintf
+++ b/modules/vasnprintf
@@ -10,7 +10,6 @@
 lib/vasnprintf.h
 lib/vasnprintf.c
 lib/asnprintf.c
-m4/longdouble.m4
 m4/wchar_t.m4
 m4/wint_t.m4
 m4/longlong.m4
--- a/modules/vasnprintf-posix-tests
+++ b/modules/vasnprintf-posix-tests
@@ -2,14 +2,12 @@
 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
 
--- a/modules/vasprintf-posix-tests
+++ b/modules/vasprintf-posix-tests
@@ -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
--- a/modules/vsnprintf-posix-tests
+++ b/modules/vsnprintf-posix-tests
@@ -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
--- a/modules/vsprintf-posix-tests
+++ b/modules/vsprintf-posix-tests
@@ -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
--- a/tests/test-isnanl-nolibm.c
+++ b/tests/test-isnanl-nolibm.c
@@ -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
--- a/tests/test-isnanl.c
+++ b/tests/test-isnanl.c
@@ -19,18 +19,6 @@
 
 #include <config.h>
 
-#if HAVE_LONG_DOUBLE
-
 #include "isnanl.h"
 
 #include "test-isnanl.h"
-
-#else
-
-int
-main ()
-{
-  return 0;
-}
-
-#endif
--- a/tests/test-snprintf-posix.h
+++ b/tests/test-snprintf-posix.h
@@ -85,7 +85,6 @@
     ASSERT (retval == strlen (result));
   }
 
-#if HAVE_LONG_DOUBLE
   {
     char result[100];
     int retval =
@@ -93,7 +92,6 @@
     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 @@
     ASSERT (retval == strlen (result));
   }
 
-#if HAVE_LONG_DOUBLE
-
   { /* A positive number.  */
     char result[100];
     int retval =
@@ -615,8 +611,6 @@
     ASSERT (retval == strlen (result));
   }
 
-#endif
-
   /* Test the support of the %n format directive.  */
 
   {
--- a/tests/test-sprintf-posix.h
+++ b/tests/test-sprintf-posix.h
@@ -71,7 +71,6 @@
     ASSERT (retval == strlen (result));
   }
 
-#if HAVE_LONG_DOUBLE
   {
     char result[1000];
     int retval =
@@ -79,7 +78,6 @@
     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 @@
     ASSERT (retval == strlen (result));
   }
 
-#if HAVE_LONG_DOUBLE
-
   { /* A positive number.  */
     char result[1000];
     int retval =
@@ -601,8 +597,6 @@
     ASSERT (retval == strlen (result));
   }
 
-#endif
-
   /* Test the support of the %n format directive.  */
 
   {
--- a/tests/test-vasnprintf-posix.c
+++ b/tests/test-vasnprintf-posix.c
@@ -111,7 +111,6 @@
     free (result);
   }
 
-#if HAVE_LONG_DOUBLE
   {
     size_t length;
     char *result =
@@ -121,7 +120,6 @@
     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 @@
     free (result);
   }
 
-#if HAVE_LONG_DOUBLE
-
   { /* A positive number.  */
     size_t length;
     char *result =
@@ -743,8 +739,6 @@
     free (result);
   }
 
-#endif
-
   /* Test the support of the %n format directive.  */
 
   {
--- a/tests/test-vasnprintf-posix2.c
+++ b/tests/test-vasnprintf-posix2.c
@@ -49,8 +49,6 @@
     free (result);
   }
 
-#if HAVE_LONG_DOUBLE
-
   /* Test that a locale dependent decimal point is used.  */
   {
     size_t length;
@@ -64,7 +62,5 @@
     free (result);
   }
 
-#endif
-
   return 0;
 }
--- a/tests/test-vasprintf-posix.c
+++ b/tests/test-vasprintf-posix.c
@@ -92,7 +92,6 @@
     free (result);
   }
 
-#if HAVE_LONG_DOUBLE
   {
     char *result;
     int retval =
@@ -102,7 +101,6 @@
     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 @@
     free (result);
   }
 
-#if HAVE_LONG_DOUBLE
-
   { /* A positive number.  */
     char *result;
     int retval =
@@ -724,8 +720,6 @@
     free (result);
   }
 
-#endif
-
   /* Test the support of the %n format directive.  */
 
   {