diff options
Diffstat (limited to 'winsup/mingw/mingwex/gdtoa/mingw_snprintf.c')
-rwxr-xr-x | winsup/mingw/mingwex/gdtoa/mingw_snprintf.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/winsup/mingw/mingwex/gdtoa/mingw_snprintf.c b/winsup/mingw/mingwex/gdtoa/mingw_snprintf.c index 0bdd52f..5df2ab1 100755 --- a/winsup/mingw/mingwex/gdtoa/mingw_snprintf.c +++ b/winsup/mingw/mingwex/gdtoa/mingw_snprintf.c @@ -91,8 +91,10 @@ THIS SOFTWARE. #include <math.h> #include <stdint.h> -#include "gdtoa.h" - +#include "gdtoaimp.h" +#ifdef USE_LOCALE +#include "locale.h" +#endif /* * For a MinGW build, we provide the implementation dependent entries @@ -381,6 +383,12 @@ x_sprintf static char hex[] = "0123456789abcdef"; static char Hex[] = "0123456789ABCDEF"; +#ifdef USE_LOCALE + char decimalpoint = *localeconv()->decimal_point; +#else + static const char decimalpoint = '.'; +#endif + ob0 = outbuf = f->ob0; rv = 0; for(;;) { @@ -751,7 +759,7 @@ x_sprintf if (decpt <= 0) { put('0') if (prec > 0 || alt) - put('.') + put(decimalpoint) while(decpt < 0) { put('0') prec--; @@ -768,7 +776,7 @@ x_sprintf } while(--decpt > 0); if (prec > 0 || alt) - put('.') + put(decimalpoint) } while(--prec >= 0) { if ((c = *s)) @@ -868,7 +876,7 @@ x_sprintf put(sign) put(*s++) if (prec || alt) - put('.') + put(decimalpoint) while(--prec >= 0) { if ((c = *s)) s++; |