]> git.saurik.com Git - apple/libc.git/blob - gdtoa/FreeBSD/gdtoa-strtof.c.patch
Libc-391.5.22.tar.gz
[apple/libc.git] / gdtoa / FreeBSD / gdtoa-strtof.c.patch
1 --- gdtoa-strtof.c.orig 2005-01-20 20:12:37.000000000 -0800
2 +++ gdtoa-strtof.c 2005-02-17 12:49:28.000000000 -0800
3 @@ -29,13 +29,15 @@
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 float
12 #ifdef KR_headers
13 -strtof(s, sp) CONST char *s; char **sp;
14 +strtof_l(s, sp, loc) CONST char *s; char **sp; locale_t loc;
15 #else
16 -strtof(CONST char *s, char **sp)
17 +strtof_l(CONST char *s, char **sp, locale_t loc)
18 #endif
19 {
20 static FPI fpi = { 24, 1-127-24+1, 254-127-24+1, 1, SI };
21 @@ -44,7 +46,8 @@
22 int k;
23 union { ULong L[1]; float f; } u;
24
25 - k = strtodg(s, sp, &fpi, &exp, bits);
26 + NORMALIZE_LOCALE(loc);
27 + k = strtodg(s, sp, &fpi, &exp, bits, loc);
28 switch(k & STRTOG_Retmask) {
29 case STRTOG_NoNumber:
30 case STRTOG_Zero:
31 @@ -71,3 +74,13 @@
32 u.L[0] |= 0x80000000L;
33 return u.f;
34 }
35 +
36 + float
37 +#ifdef KR_headers
38 +strtof(s, sp) CONST char *s; char **sp;
39 +#else
40 +strtof(CONST char *s, char **sp)
41 +#endif
42 +{
43 + return strtof_l(s, sp, __current_locale());
44 +}