From cc93c29f149b81e8270a192762ea341d044d334f Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 19 Sep 2017 11:38:51 +0000 Subject: 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 --- src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/drivers/WinAPI') 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; } -- cgit v1.2.3