Back to index

glibc  2.9
strtold.c
Go to the documentation of this file.
00001 /* Read decimal floating point numbers.
00002    This file is part of the GNU C Library.
00003    Copyright (C) 1995-2002,2003,2004,2006,2007 Free Software Foundation, Inc.
00004    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 /* The actual implementation for all floating point sizes is in strtod.c.
00022    These macros tell it to produce the `float' version, `strtof'.  */
00023 
00024 #include <bits/wordsize.h>
00025 
00026 #ifdef __LONG_DOUBLE_MATH_OPTIONAL
00027 # include <wchar.h>
00028 # define NEW(x) NEW1(x)
00029 # define NEW1(x) __new_##x
00030 long double ____new_strtold_internal (const char *, char **, int);
00031 long double __new_strtold (const char *, char **);
00032 long double ____new_wcstold_internal (const wchar_t *, wchar_t **, int);
00033 long double __new_wcstold (const wchar_t *, wchar_t **);
00034 libc_hidden_proto (____new_strtold_internal)
00035 libc_hidden_proto (____new_wcstold_internal)
00036 libc_hidden_proto (__new_strtold)
00037 libc_hidden_proto (__new_wcstold)
00038 #else
00039 # define NEW(x) x
00040 #endif
00041 
00042 #define       FLOAT         long double
00043 #define       FLT           LDBL
00044 #ifdef USE_WIDE_CHAR
00045 # define STRTOF             NEW (wcstold)
00046 # define STRTOF_L    __wcstold_l
00047 #else
00048 # define STRTOF             NEW (strtold)
00049 # define STRTOF_L    __strtold_l
00050 #endif
00051 
00052 #include "strtod.c"
00053 
00054 #ifdef __LONG_DOUBLE_MATH_OPTIONAL
00055 # include <math_ldbl_opt.h>
00056 # ifdef USE_WIDE_CHAR
00057 long_double_symbol (libc, __new_wcstold, wcstold);
00058 long_double_symbol (libc, ____new_wcstold_internal, __wcstold_internal);
00059 libc_hidden_ver (____new_wcstold_internal, __wcstold_internal)
00060 # else
00061 long_double_symbol (libc, __new_strtold, strtold);
00062 long_double_symbol (libc, ____new_strtold_internal, __strtold_internal);
00063 libc_hidden_ver (____new_strtold_internal, __strtold_internal)
00064 # endif
00065 #endif