From 0d675cb048b9fd4ad5365e6df336b33ae3374275 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 17 Jun 2017 14:26:25 +0200 Subject: [PATCH] MSVC: Disable warning about single line comments in system headers --- cJSON.c | 8 ++++++++ cJSON_Utils.c | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/cJSON.c b/cJSON.c index 9c86128..e816cde 100644 --- a/cJSON.c +++ b/cJSON.c @@ -31,6 +31,11 @@ #ifdef __GNUC__ #pragma GCC visibility push(default) #endif +#if defined(_MSC_VER) +#pragma warning (push) +/* disable warning about single line comments in system headers */ +#pragma warning (disable : 4001) +#endif #include #include @@ -41,6 +46,9 @@ #include #include +#if defined(_MSC_VER) +#pragma warning (pop) +#endif #ifdef __GNUC__ #pragma GCC visibility pop #endif diff --git a/cJSON_Utils.c b/cJSON_Utils.c index 2baa492..b83cfcd 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -28,11 +28,21 @@ #ifdef __GNUCC__ #pragma GCC visibility push(default) #endif +#if defined(_MSC_VER) +#pragma warning (push) +/* disable warning about single line comments in system headers */ +#pragma warning (disable : 4001) +#endif + #include #include #include #include #include + +#if defined(_MSC_VER) +#pragma warning (pop) +#endif #ifdef __GNUCC__ #pragma GCC visibility pop #endif