Skip to content

Commit

Permalink
fix compiler warning on __STDC_FORMAT_MACROS redef
Browse files Browse the repository at this point in the history
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: kazuho/picojson#127
  • Loading branch information
NikolausDemmel authored May 13, 2020
1 parent 1a94ff7 commit 5db9dbc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/pangolin/utils/picojson.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <errno.h>
# include <inttypes.h>
#endif // PICOJSON_USE_INT64
Expand Down

0 comments on commit 5db9dbc

Please sign in to comment.