Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp A. Hartmann <pah@qo.cx>2014-07-08 16:45:19 +0400
committerPhilipp A. Hartmann <pah@qo.cx>2014-07-08 16:45:19 +0400
commit813da24d72043882ed609150338c38fa3fd4faf9 (patch)
treef6a77dc473f0b4c5048ab28d5e899fb1591f8160 /include/rapidjson/encodedstream.h
parent9ff95ca2cf09c9ab2cb07f7cfdeaa803512c1af6 (diff)
Add RAPIDJSON_DIAG_* macros to handle compiler warnings
Warning push/pop support has been added to GCC in version 4.6.0, and pragmas to ignore certain warnings are present since 4.2.0. This patch hides the compiler-specific warning push/pop/disable pragmas behind a macro-based implementation (currently for MSVC and clang /GCC. This avoids warnings, as seen e.g. on GCC 4.4: ../../include/rapidjson/document.h:14: error: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’ and earlier versions complaining about unknown pragmas being ignored. Note: unittest.h and perftest.h need to check for compilers explicitly, as rapidjson.h is not included there.
Diffstat (limited to 'include/rapidjson/encodedstream.h')
-rw-r--r--include/rapidjson/encodedstream.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/rapidjson/encodedstream.h b/include/rapidjson/encodedstream.h
index a11547a1..83457432 100644
--- a/include/rapidjson/encodedstream.h
+++ b/include/rapidjson/encodedstream.h
@@ -4,8 +4,8 @@
#include "rapidjson.h"
#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Weffc++"
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
#endif
namespace rapidjson {
@@ -264,7 +264,7 @@ private:
} // namespace rapidjson
#ifdef __GNUC__
-#pragma GCC diagnostic pop
+RAPIDJSON_DIAG_POP
#endif
#endif // RAPIDJSON_FILESTREAM_H_