chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / sysdeps / ieee754 / ldbl-96 / strtold_l.c
1 /* Copyright (C) 1999, 2004, 2005 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, write to the Free
16    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17    02111-1307 USA.  */
18
19 #include <math.h>
20
21 /* The actual implementation for all floating point sizes is in strtod.c.
22    These macros tell it to produce the `long double' version, `strtold'.  */
23
24 #define FLOAT           long double
25 #define FLT             LDBL
26 #ifdef USE_WIDE_CHAR
27 # define STRTOF         wcstold_l
28 # define __STRTOF       __wcstold_l
29 #else
30 # define STRTOF         strtold_l
31 # define __STRTOF       __strtold_l
32 #endif
33 #define MPN2FLOAT       __mpn_construct_long_double
34 #define FLOAT_HUGE_VAL  HUGE_VALL
35 #define SET_MANTISSA(flt, mant) \
36   do { union ieee854_long_double u;                                           \
37        u.d = (flt);                                                           \
38        if ((mant & 0x7fffffffffffffffULL) == 0)                               \
39          mant = 0x4000000000000000ULL;                                        \
40        u.ieee.mantissa0 = (((mant) >> 32) & 0x7fffffff) | 0x80000000;         \
41        u.ieee.mantissa1 = (mant) & 0xffffffff;                                \
42        (flt) = u.d;                                                           \
43   } while (0)
44
45 #include <stdlib/strtod_l.c>