diff options
| author | Manolo Gouy <Manolo> | 2017-09-19 11:38:51 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-09-19 11:38:51 +0000 |
| commit | cc93c29f149b81e8270a192762ea341d044d334f (patch) | |
| tree | 03a2f2edc4e8cd96d25d2236e110b88051103e5b /src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx | |
| parent | b258f4b0295b72bfe7774d727cca8e0911c9c0e3 (diff) | |
Fl_XXX_System_Driver::clocale_printf() : use thread-specific, locale-setting APIs where possible
This commit uses thread-specific, locale-setting functions under Linux and MSWindows-Visual Studio
They are already used by the Mac OS system driver, when possible.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12461 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx')
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx index 007f73d0e..219cfad80 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx @@ -450,10 +450,15 @@ unsigned Fl_WinAPI_System_Driver::utf8from_mb(char* dst, unsigned dstlen, const } int Fl_WinAPI_System_Driver::clocale_printf(FILE *output, const char *format, va_list args) { +#if defined(_MSC_VER) && (_MSC_VER >= 1400 /*Visual Studio 2005*/) + static _locale_t c_locale = _create_locale(LC_NUMERIC, "C"); + int retval = _vfprintf_l(output, format, c_locale, args); +#else char *saved_locale = setlocale(LC_NUMERIC, NULL); setlocale(LC_NUMERIC, "C"); int retval = vfprintf(output, format, args); setlocale(LC_NUMERIC, saved_locale); +#endif return retval; } |
