Update copyright notices with scripts/update-copyrights
[glibc.git] / sysdeps / ieee754 / ldbl-128 / strtold_l.c
blobb22cfe76517ed63a42c15976b8e55169e2154d48
1 /* Copyright (C) 1999-2014 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
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.
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.
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 <http://www.gnu.org/licenses/>. */
18 #include <math.h>
20 /* The actual implementation for all floating point sizes is in strtod.c.
21 These macros tell it to produce the `long double' version, `strtold'. */
23 #define FLOAT long double
24 #define FLT LDBL
25 #ifdef USE_WIDE_CHAR
26 # define STRTOF wcstold_l
27 # define __STRTOF __wcstold_l
28 #else
29 # define STRTOF strtold_l
30 # define __STRTOF __strtold_l
31 #endif
32 #define MPN2FLOAT __mpn_construct_long_double
33 #define FLOAT_HUGE_VAL HUGE_VALL
34 #define SET_MANTISSA(flt, mant) \
35 do { union ieee854_long_double u; \
36 u.d = (flt); \
37 u.ieee_nan.mantissa0 = 0; \
38 u.ieee_nan.mantissa1 = 0; \
39 u.ieee_nan.mantissa2 = (mant) >> 32; \
40 u.ieee_nan.mantissa3 = (mant); \
41 if ((u.ieee.mantissa0 | u.ieee.mantissa1 \
42 | u.ieee.mantissa2 | u.ieee.mantissa3) != 0) \
43 (flt) = u.d; \
44 } while (0)
46 #include <strtod_l.c>