From 5db9dbc71277ae780e64607832e50437801832a9 Mon Sep 17 00:00:00 2001 From: Nikolaus Demmel Date: Wed, 13 May 2020 19:38:31 +0200 Subject: [PATCH] fix compiler warning on __STDC_FORMAT_MACROS redef Without this, if I include 2 libraries that define this macro, I get warnings like ``` warning: '__STDC_FORMAT_MACROS' macro redefined [-Wmacro-redefined] ``` This is on macos 10.15 with AppleClang 11. See also upstream PR: https://github.com/kazuho/picojson/pull/127 --- include/pangolin/utils/picojson.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/pangolin/utils/picojson.h b/include/pangolin/utils/picojson.h index 3791ee6b7..85252691f 100644 --- a/include/pangolin/utils/picojson.h +++ b/include/pangolin/utils/picojson.h @@ -69,7 +69,9 @@ extern "C" { // experimental support for int64_t (see README.mkdn for detail) #ifdef PICOJSON_USE_INT64 -# define __STDC_FORMAT_MACROS +# ifndef __STDC_FORMAT_MACROS +# define __STDC_FORMAT_MACROS +# endif # include # include #endif // PICOJSON_USE_INT64