X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fxstrtod.c;h=4b4c12afb79b42a15e877bf657be3d4f2d53a8b8;hb=a655ee23a7d332ff458d3785df802f69acd6ea4f;hp=bab8b1219a21f351d88ced4ef907d2eca6163e44;hpb=3738de89a7147a0e0fe78f80757caedc6834cf3a;p=gnulib.git diff --git a/lib/xstrtod.c b/lib/xstrtod.c index bab8b1219..4b4c12afb 100644 --- a/lib/xstrtod.c +++ b/lib/xstrtod.c @@ -1,9 +1,28 @@ +/* xstrtod.c - error-checking interface to strtod + Copyright (C) 1996, 1999, 2000 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 + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by Jim Meyering. */ + #ifdef HAVE_CONFIG_H -#include +# include #endif #ifdef STDC_HEADERS -#include +# include #else double strtod (); #endif @@ -11,13 +30,17 @@ double strtod (); #include #include #include -#include #include "xstrtod.h" +/* Tell the compiler that non-default rounding modes are used. */ +#if 199901 <= __STDC_VERSION__ + #pragma STDC FENV_ACCESS ON +#endif + /* An interface to strtod that encapsulates all the error checking - one should usually perform. Like strtod, but return zero upon - successful conversion and put the result in *RESULT. Return - non-zero upon any failure. */ + one should usually perform. Like strtod, but upon successful + conversion put the result in *RESULT and return zero. Return + non-zero and don't modify *RESULT upon any failure. */ int xstrtod (str, ptr, result) @@ -50,4 +73,3 @@ xstrtod (str, ptr, result) *result = val; return fail; } -