diff options
| author | Manolo Gouy <Manolo> | 2016-03-30 15:47:23 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-30 15:47:23 +0000 |
| commit | 2ac2b506a8ea6e0656a8bb6f81a8f0c1887256b7 (patch) | |
| tree | 56e1b03c337a5d5c6b920a35a4ed7bf77ea40e3a /src/drivers/Darwin | |
| parent | fc7b00dad8f84bf0afb58323258100b3c82321a9 (diff) | |
Begin to rewrite Fl_PostScript.cxx under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11474 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Darwin')
| -rw-r--r-- | src/drivers/Darwin/Fl_Darwin_System_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/Darwin/Fl_Darwin_System_Driver.cxx | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H index bafa422d2..910270653 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H @@ -62,6 +62,7 @@ public: virtual int unlink(const char* f) {return ::unlink(f);} virtual int rmdir(const char* f) {return ::rmdir(f);} virtual int rename(const char* f, const char *n) {return ::rename(f, n);} + virtual int clocale_printf(FILE *output, const char *format, va_list args); }; #endif // FL_DARWIN_SYSTEM_DRIVER_H diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx index 590e23d0b..1430be536 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx @@ -22,6 +22,12 @@ #include <FL/Fl.H> #include <FL/x.H> #include <string.h> +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 +#include <xlocale.h> +#else +#include <locale.h> +#endif +#include <stdio.h> int Fl_X::next_marked_length = 0; @@ -90,6 +96,22 @@ int Fl_Darwin_System_Driver::compose(int &del) { return 1; } +int Fl_Darwin_System_Driver::clocale_printf(FILE *output, const char *format, va_list args) { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 + if (fl_mac_os_version >= 100400) { + static locale_t postscript_locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0); + return vfprintf_l(output, postscript_locale, format, args); + } +#else + char *saved_locale = setlocale(LC_NUMERIC, NULL); + setlocale(LC_NUMERIC, "C"); + int retval = vfprintf(output, format, args); + setlocale(LC_NUMERIC, saved_locale); + return retval; +#endif +} + + // // End of "$Id$". // |
