]> git.saurik.com Git - apple/libc.git/blob - gdtoa/FreeBSD/machdep_ldisdd.c.patch
Libc-391.5.22.tar.gz
[apple/libc.git] / gdtoa / FreeBSD / machdep_ldisdd.c.patch
1 --- machdep_ldisdd.c.orig 2004-09-20 17:32:38.000000000 -0700
2 +++ machdep_ldisdd.c 2005-02-19 03:07:38.000000000 -0800
3 @@ -32,13 +32,34 @@
4
5 #include <sys/cdefs.h>
6
7 +#include "xlocale_private.h"
8 +
9 #include "gdtoaimp.h"
10
11 long double
12 strtold(const char * __restrict s, char ** __restrict sp)
13 {
14 +#ifdef LDBL_COMPAT
15 + return (long double)strtod_l(s, sp, __current_locale());
16 +#else /* LDBL_COMPAT */
17 + long double result;
18 +
19 + strtopdd(s, sp, (double *)&result, __current_locale());
20 + return result;
21 +#endif /* LDBL_COMPAT */
22 +}
23 +
24 +long double
25 +strtold_l(const char * __restrict s, char ** __restrict sp, locale_t loc)
26 +{
27 +#ifdef LDBL_COMPAT
28 + NORMALIZE_LOCALE(loc);
29 + return (long double)strtod_l(s, sp, loc);
30 +#else /* LDBL_COMPAT */
31 long double result;
32
33 - strtopdd(s, sp, &result);
34 + NORMALIZE_LOCALE(loc);
35 + strtopdd(s, sp, (double *)&result, loc);
36 return result;
37 +#endif /* LDBL_COMPAT */
38 }