Suppress Visual Studio warnings in nanosvg code

- disable warning C4244 (conversion / data loss)
- restore #pragma warning after nanosvg includes
This commit is contained in:
Albrecht Schlosser 2021-02-23 22:37:50 +01:00
parent 374232e2f4
commit 3e0c30213b
1 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,11 @@ static double strtoll(const char *str, char **endptr, int base) {
}
#endif
#ifdef _MSC_VER
#pragma warning (push) // Save #pragma warning status
#pragma warning (disable: 4244) // Switch off conversion warnings
#endif
#define NANOSVG_ALL_COLOR_KEYWORDS // Include full list of color keywords.
#define NANOSVG_IMPLEMENTATION // Expands implementation
#include "../nanosvg/nanosvg.h"
@ -39,6 +44,10 @@ static double strtoll(const char *str, char **endptr, int base) {
#define NANOSVGRAST_IMPLEMENTATION // Expands implementation
#include "../nanosvg/nanosvgrast.h"
#ifdef _MSC_VER
#pragma warning (pop) // Restore #pragma warning status
#endif
#if defined(HAVE_LIBZ)
#include <zlib.h>
#endif