From 28a169725ea8e108bb6cde599dd2d4c1154ba6b0 Mon Sep 17 00:00:00 2001 From: Giovanni Cerretani Date: Thu, 26 Aug 2021 07:35:01 +0200 Subject: [PATCH] Fix -Wunused warnings on JSON_DIAGNOSTICS (#2976) * Fix #2975 Define JSON_DIAGNOSTICS to 0 if not defined to fix annoying Wundef warnings. * amalgamated --- include/nlohmann/detail/macro_scope.hpp | 4 ++++ single_include/nlohmann/json.hpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/nlohmann/detail/macro_scope.hpp b/include/nlohmann/detail/macro_scope.hpp index 400530a60..76a0dc62c 100644 --- a/include/nlohmann/detail/macro_scope.hpp +++ b/include/nlohmann/detail/macro_scope.hpp @@ -301,3 +301,7 @@ #else #define JSON_EXPLICIT explicit #endif + +#ifndef JSON_DIAGNOSTICS + #define JSON_DIAGNOSTICS 0 +#endif diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 5ba4a4bed..fd97d9c28 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -2514,6 +2514,10 @@ JSON_HEDLEY_DIAGNOSTIC_POP #define JSON_EXPLICIT explicit #endif +#ifndef JSON_DIAGNOSTICS + #define JSON_DIAGNOSTICS 0 +#endif + namespace nlohmann {