]> git.saurik.com Git - apple/libc.git/blob - gdtoa/FreeBSD/gdtoa-strtod.c.patch
99db605f3be117502021c49439c318e4371bd283
[apple/libc.git] / gdtoa / FreeBSD / gdtoa-strtod.c.patch
1 --- gdtoa-strtod.c.orig 2005-10-08 11:32:33.000000000 -0700
2 +++ gdtoa-strtod.c 2005-10-08 11:38:17.000000000 -0700
3 @@ -29,6 +29,8 @@
4 /* Please send bug reports to David M. Gay (dmg at acm dot org,
5 * with " at " changed at "@" and " dot " changed to "."). */
6
7 +#include "xlocale_private.h"
8 +
9 #include "gdtoaimp.h"
10 #ifndef NO_FENV_H
11 #include <fenv.h>
12 @@ -59,11 +61,11 @@
13 #endif
14
15 double
16 -strtod
17 +strtod_l
18 #ifdef KR_headers
19 - (s00, se) CONST char *s00; char **se;
20 + (s00, se, loc) CONST char *s00; char **se; locale_t loc;
21 #else
22 - (CONST char *s00, char **se)
23 + (CONST char *s00, char **se, locale_t loc)
24 #endif
25 {
26 #ifdef Avoid_Underflow
27 @@ -126,7 +128,7 @@
28 #else
29 #define fpi1 fpi
30 #endif
31 - switch((i = gethex(&s, &fpi1, &exp, &bb, sign)) & STRTOG_Retmask) {
32 + switch((i = gethex(&s, &fpi1, &exp, &bb, sign, loc)) & STRTOG_Retmask) {
33 case STRTOG_NoNumber:
34 s = s00;
35 sign = 0;
36 @@ -156,8 +158,9 @@
37 else if (nd < 16)
38 z = 10*z + c - '0';
39 nd0 = nd;
40 + NORMALIZE_LOCALE(loc);
41 #ifdef USE_LOCALE
42 - if (c == *localeconv()->decimal_point)
43 + if (c == *localeconv_l(loc)->decimal_point)
44 #else
45 if (c == '.')
46 #endif
47 @@ -980,3 +983,13 @@
48 return sign ? -dval(rv) : dval(rv);
49 }
50
51 + double
52 +strtod
53 +#ifdef KR_headers
54 + (s00, se) CONST char *s00; char **se;
55 +#else
56 + (CONST char *s00, char **se)
57 +#endif
58 +{
59 + return strtod_l(s00, se, __current_locale());
60 +}