From 0bf5f9809a0c5c15cfc486e215f30a2a539e088e Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 7 Sep 2017 20:16:08 +0000 Subject: Modify nanosvg.h to support compilation by Visual Studio 7. This is a new implementation that does not tamper with the program's locale. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12431 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_SVG_Image.cxx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/Fl_SVG_Image.cxx b/src/Fl_SVG_Image.cxx index 87ea71a46..7723f56af 100644 --- a/src/Fl_SVG_Image.cxx +++ b/src/Fl_SVG_Image.cxx @@ -28,8 +28,13 @@ #include #endif -// the C locale is set in init_() before calling nsvgParse(), therefore plain atof() can be used -#define nsvg__atof(s) atof(s) +#ifdef HAVE_LONG_LONG + typedef long long fl_nsvg_int; +#else + typedef long fl_nsvg_int; +# define strtoll(a, b, c) strtol(a, b, c) +#endif + #define NANOSVG_ALL_COLOR_KEYWORDS // Include full list of color keywords. #define NANOSVG_IMPLEMENTATION // Expands implementation @@ -104,14 +109,7 @@ void Fl_SVG_Image::init_(const char *filename, char *filedata, Fl_SVG_Image *cop } else ld(ERR_FILE_ACCESS); } if (filedata) { -#if HAVE_LOCALE_H - char *saved_locale = setlocale(LC_NUMERIC, NULL); - setlocale(LC_NUMERIC, "C"); -#endif counted_svg_image_->svg_image = nsvgParse(filedata, "px", 96); -#if HAVE_LOCALE_H - setlocale(LC_NUMERIC, saved_locale); -#endif if (filename) free(filedata); if (counted_svg_image_->svg_image->width == 0 || counted_svg_image_->svg_image->height == 0) { d(-1); -- cgit v1.2.3