]> git.saurik.com Git - apple/libc.git/blob - gdtoa/FreeBSD/gdtoa-strtod.c.patch
Libc-391.2.5.tar.gz
[apple/libc.git] / gdtoa / FreeBSD / gdtoa-strtod.c.patch
1 --- gdtoa-strtod.c.orig 2005-01-20 20:12:37.000000000 -0800
2 +++ gdtoa-strtod.c 2005-02-17 01:31:26.000000000 -0800
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
11 #ifdef USE_LOCALE
12 @@ -56,11 +58,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 @@ -112,7 +114,7 @@
28 switch(s[1]) {
29 case 'x':
30 case 'X':
31 - switch((i = gethex(&s, &fpi, &exp, &bb, sign)) & STRTOG_Retmask) {
32 + switch((i = gethex(&s, &fpi, &exp, &bb, sign, loc)) & STRTOG_Retmask) {
33 case STRTOG_NoNumber:
34 s = s00;
35 sign = 0;
36 @@ -142,8 +144,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 @@ -966,3 +969,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 +}