]>
Commit | Line | Data |
---|---|---|
34e8f829 A |
1 | --- gdtoa-gethex.c.orig 2008-10-28 11:14:40.000000000 -0700 |
2 | +++ gdtoa-gethex.c 2008-10-28 11:20:32.000000000 -0700 | |
3 | @@ -29,6 +29,8 @@ THIS SOFTWARE. | |
3d9156a7 A |
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 | |
34e8f829 | 12 | @@ -37,10 +39,10 @@ THIS SOFTWARE. |
3d9156a7 A |
13 | |
14 | int | |
15 | #ifdef KR_headers | |
16 | -gethex(sp, fpi, exp, bp, sign) | |
17 | - CONST char **sp; FPI *fpi; Long *exp; Bigint **bp; int sign; | |
18 | +gethex(sp, fpi, exp, bp, sign, loc) | |
19 | + CONST char **sp; FPI *fpi; Long *exp; Bigint **bp; int sign; locale_t loc; | |
20 | #else | |
21 | -gethex( CONST char **sp, FPI *fpi, Long *exp, Bigint **bp, int sign) | |
22 | +gethex( CONST char **sp, FPI *fpi, Long *exp, Bigint **bp, int sign, locale_t loc) | |
23 | #endif | |
24 | { | |
25 | Bigint *b; | |
34e8f829 | 26 | @@ -50,13 +52,14 @@ gethex( CONST char **sp, FPI *fpi, Long |
3d9156a7 A |
27 | Long e, e1; |
28 | #ifdef USE_LOCALE | |
34e8f829 | 29 | int i; |
3d9156a7 | 30 | + NORMALIZE_LOCALE(loc); |
34e8f829 A |
31 | #ifdef NO_LOCALE_CACHE |
32 | - const unsigned char *decimalpoint = (unsigned char*)localeconv()->decimal_point; | |
33 | + const unsigned char *decimalpoint = (unsigned char*)localeconv_l(loc)->decimal_point; | |
3d9156a7 | 34 | #else |
34e8f829 A |
35 | const unsigned char *decimalpoint; |
36 | static unsigned char *decimalpoint_cache; | |
37 | if (!(s0 = decimalpoint_cache)) { | |
38 | - s0 = (unsigned char*)localeconv()->decimal_point; | |
39 | + s0 = (unsigned char*)localeconv_l(loc)->decimal_point; | |
40 | if ((decimalpoint_cache = (char*)malloc(strlen(s0) + 1))) { | |
41 | strcpy(decimalpoint_cache, s0); | |
42 | s0 = decimalpoint_cache; |