1 --- gdtoa_strtopx.c.orig 2007-04-03 12:19:28.000000000 -0700
2 +++ gdtoa_strtopx.c 2007-04-06 12:52:09.000000000 -0700
4 /* Please send bug reports to David M. Gay (dmg at acm dot org,
5 * with " at " changed at "@" and " dot " changed to "."). */
7 +#include "xlocale_private.h"
16 -strtopx(s, sp, V) CONST char *s; char **sp; void *V;
17 +strtopx(s, sp, V, loc) CONST char *s; char **sp; void *V; locale_t loc;
19 -strtopx(CONST char *s, char **sp, void *V)
20 +strtopx(CONST char *s, char **sp, void *V, locale_t loc)
23 - static FPI fpi = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI };
24 + static FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI };
28 UShort *L = (UShort*)V;
29 + FPI *fpi = &fpi0, fpi1;
30 +#ifdef Honor_FLT_ROUNDS
31 + int rounding = Flt_Rounds;
34 - k = strtodg(s, sp, &fpi, &exp, bits);
35 +#ifdef Honor_FLT_ROUNDS
36 + if (rounding != fpi0.rounding) {
37 + fpi1 = fpi0; /* for thread safety */
38 + fpi1.rounding = rounding;
41 +#endif /* Honor_FLT_ROUNDS */
42 + k = strtodg(s, sp, fpi, &exp, bits, loc);
43 switch(k & STRTOG_Retmask) {
45 + L[0] = L[1] = L[2] = L[3] = L[4] = 0;
46 + return k; // avoid setting sign
49 L[0] = L[1] = L[2] = L[3] = L[4] = 0;
55 - L[_1] = L[_2] = L[_3] = L[_4] = 0;
56 + L[_1] = 0x8000; /* 4306392: to match gcc */
57 + L[_2] = L[_3] = L[_4] = 0;