Allow inclusion from <fcntl.h>.
[glibc.git] / stdlib / strtold.c
blob1f56deaa01eec95af167d567313932444178b785
1 /* Read decimal floating point numbers.
2 This file is part of the GNU C Library.
3 Copyright (C) 1995-2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
21 /* The actual implementation for all floating point sizes is in strtod.c.
22 These macros tell it to produce the `float' version, `strtof'. */
24 #include <bits/wordsize.h>
26 #ifdef __LONG_DOUBLE_MATH_OPTIONAL
27 # include <wchar.h>
28 # define NEW(x) NEW1(x)
29 # define NEW1(x) __new_##x
30 long double ____new_strtold_internal (const char *, char **, int);
31 long double __new_strtold (const char *, char **);
32 long double ____new_wcstold_internal (const wchar_t *, wchar_t **, int);
33 long double __new_wcstold (const wchar_t *, wchar_t **);
34 libc_hidden_proto (____new_strtold_internal)
35 libc_hidden_proto (____new_wcstold_internal)
36 #else
37 # define NEW(x) x
38 #endif
40 #define FLOAT long double
41 #define FLT LDBL
42 #ifdef USE_WIDE_CHAR
43 # define STRTOF NEW (wcstold)
44 # define STRTOF_L __wcstold_l
45 #else
46 # define STRTOF NEW (strtold)
47 # define STRTOF_L __strtold_l
48 #endif
50 #include "strtod.c"
52 #ifdef __LONG_DOUBLE_MATH_OPTIONAL
53 # include <math_ldbl_opt.h>
54 # ifdef USE_WIDE_CHAR
55 long_double_symbol (libc, __new_wcstold, wcstold);
56 long_double_symbol (libc, ____new_wcstold_internal, __wcstold_internal);
57 libc_hidden_ver (____new_wcstold_internal, __wcstold_internal)
58 # else
59 long_double_symbol (libc, __new_strtold, strtold);
60 long_double_symbol (libc, ____new_strtold_internal, __strtold_internal);
61 libc_hidden_ver (____new_strtold_internal, __strtold_internal)
62 # endif
63 #endif