diff options
| author | Manolo Gouy <Manolo> | 2017-09-07 20:16:08 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-09-07 20:16:08 +0000 |
| commit | 0bf5f9809a0c5c15cfc486e215f30a2a539e088e (patch) | |
| tree | 5ba5f7d8e0b79bf834411ccf1908de9bca4c5f4d /src | |
| parent | a222837123345072d8c38c2d599b492b3c4311bd (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_SVG_Image.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
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 <locale.h> #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); |
