1 | /* Copyright (C) 1999-2022 Free Software Foundation, Inc. |
2 | This file is part of the GNU C Library. |
3 | |
4 | The GNU C Library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either |
7 | version 2.1 of the License, or (at your option) any later version. |
8 | |
9 | The GNU C Library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Lesser General Public License for more details. |
13 | |
14 | You should have received a copy of the GNU Lesser General Public |
15 | License along with the GNU C Library; if not, see |
16 | <https://www.gnu.org/licenses/>. */ |
17 | |
18 | #include <math.h> |
19 | #include <stdlib.h> |
20 | #include <wchar.h> |
21 | |
22 | /* The actual implementation for all floating point sizes is in strtod.c. |
23 | These macros tell it to produce the `long double' version, `strtold'. */ |
24 | |
25 | #define FLOAT long double |
26 | #define FLT LDBL |
27 | #ifdef USE_WIDE_CHAR |
28 | extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, locale_t); |
29 | # define STRTOF __new_wcstold_l |
30 | # define __STRTOF ____new_wcstold_l |
31 | # define ____STRTOF_INTERNAL ____wcstold_l_internal |
32 | # define STRTOF_NAN __wcstold_nan |
33 | #else |
34 | extern long double ____new_strtold_l (const char *, char **, locale_t); |
35 | # define STRTOF __new_strtold_l |
36 | # define __STRTOF ____new_strtold_l |
37 | # define ____STRTOF_INTERNAL ____strtold_l_internal |
38 | # define STRTOF_NAN __strtold_nan |
39 | #endif |
40 | extern __typeof (__STRTOF) STRTOF; |
41 | libc_hidden_proto (__STRTOF) |
42 | libc_hidden_proto (STRTOF) |
43 | #define MPN2FLOAT __mpn_construct_long_double |
44 | #define FLOAT_HUGE_VAL HUGE_VALL |
45 | |
46 | #include <strtod_l.c> |
47 | |
48 | #ifdef __LONG_DOUBLE_MATH_OPTIONAL |
49 | # include <math_ldbl_opt.h> |
50 | # ifdef USE_WIDE_CHAR |
51 | weak_alias (____new_wcstold_l, ___new_wcstold_l); |
52 | long_double_symbol (libc, ___new_wcstold_l, wcstold_l); |
53 | long_double_symbol (libc, ____new_wcstold_l, __wcstold_l); |
54 | # else |
55 | weak_alias (____new_strtold_l, ___new_strtold_l); |
56 | long_double_symbol (libc, ___new_strtold_l, strtold_l); |
57 | long_double_symbol (libc, ____new_strtold_l, __strtold_l); |
58 | # endif |
59 | #endif |
60 | |