summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-30 17:38:26 +0000
committerManolo Gouy <Manolo>2016-03-30 17:38:26 +0000
commit7799245100a91b10b9a4ca9c6e818a3cdd8d5dc9 (patch)
treea2bcf126f71dc23b2a812c1d58508854d3927b9c /src
parent5adda33f962a1c9798d6723aff80e94b4dee69f9 (diff)
Avoid vfprintf_l() that may be missing on Linux
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11478 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/drivers/Posix/Fl_Posix_System_Driver.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
index 2d7abb575..c6ca65585 100644
--- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx
+++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
@@ -22,9 +22,6 @@
#include <X11/Xlib.h>
#include <locale.h>
#include <stdio.h>
-#ifdef __APPLE_CC__ // allows Darwin + X11
-#include <xlocale.h>
-#endif
extern XIC fl_xim_ic; // in Fl_x.cxx
@@ -69,8 +66,11 @@ void Fl_Posix_System_Driver::compose_reset()
}
int Fl_Posix_System_Driver::clocale_printf(FILE *output, const char *format, va_list args) {
- static locale_t postscript_locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0);
- return vfprintf_l(output, postscript_locale, format, args);
+ char *saved_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
+ int retval = vfprintf(output, format, args);
+ setlocale(LC_NUMERIC, saved_locale);
+ return retval;
}
//