X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fftoastr.c;h=ebeed3e1347b454779a9a3f39ab54c251d23a977;hb=d4cecf1ee37f6b611ef092c9c7fa3761d02ce2c3;hp=ff3d87ce22d9e36e5f3048ef47ab5ca5dac64677;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/lib/ftoastr.c b/lib/ftoastr.c index ff3d87ce2..ebeed3e13 100644 --- a/lib/ftoastr.c +++ b/lib/ftoastr.c @@ -1,6 +1,6 @@ /* floating point to accurate string - Copyright (C) 2010-2011 Free Software Foundation, Inc. + Copyright (C) 2010-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,6 @@ #include "ftoastr.h" -#include "intprops.h" #include #include #include @@ -40,14 +39,15 @@ # define FLOAT_MIN LDBL_MIN # define FLOAT_PREC_BOUND _GL_LDBL_PREC_BOUND # define FTOASTR ldtoastr -# define STRTOF strtold +# if HAVE_C99_STRTOLD +# define STRTOF strtold +# endif #elif LENGTH == 2 # define FLOAT double # define FLOAT_DIG DBL_DIG # define FLOAT_MIN DBL_MIN # define FLOAT_PREC_BOUND _GL_DBL_PREC_BOUND # define FTOASTR dtoastr -# define STRTOF strtod #else # define LENGTH 1 # define FLOAT float @@ -55,14 +55,15 @@ # define FLOAT_MIN FLT_MIN # define FLOAT_PREC_BOUND _GL_FLT_PREC_BOUND # define FTOASTR ftoastr -# define STRTOF strtof +# if HAVE_STRTOF +# define STRTOF strtof +# endif #endif /* On pre-C99 hosts, approximate strtof and strtold with strtod. This may generate one or two extra digits, but that's better than not - working at all. Assume that strtof works if strtold does. */ -#if LENGTH != 2 && ! HAVE_C99_STRTOLD -# undef STRTOF + working at all. */ +#ifndef STRTOF # define STRTOF strtod #endif