diff --git a/cJSON.c b/cJSON.c index 6e8255a..9c86128 100644 --- a/cJSON.c +++ b/cJSON.c @@ -23,6 +23,11 @@ /* cJSON */ /* JSON parser in C. */ +/* disable warnings about old C89 functions in MSVC */ +#if !defined(_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) +#define _CRT_SECURE_NO_DEPRECATE +#endif + #ifdef __GNUC__ #pragma GCC visibility push(default) #endif diff --git a/cJSON_Utils.c b/cJSON_Utils.c index 84319cc..e7bf802 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -20,6 +20,10 @@ THE SOFTWARE. */ +/* disable warnings about old C89 functions in MSVC */ +#if !defined(_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) +#define _CRT_SECURE_NO_DEPRECATE +#endif #pragma GCC visibility push(default) #include #include