From 498a5314ed04db64884fe2a591f95e8f45ae944b Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 18 Feb 2014 15:42:36 -0600 Subject: [PATCH] binpac: Request format macros from inttypes.h explicitly. This helps ensure the availability of PRI* macros from .pac files, which cannot create this definition themselves since the inclusion of binpac.h is hardcoded to be placed very early in the generated code and already includes inttypes.h itself. --- tools/binpac/lib/binpac.h.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/binpac/lib/binpac.h.in b/tools/binpac/lib/binpac.h.in index f5c6e152c7..4e78b7b830 100644 --- a/tools/binpac/lib/binpac.h.in +++ b/tools/binpac/lib/binpac.h.in @@ -17,6 +17,13 @@ #include #include #include + +// Expose C99 functionality from inttypes.h, which would otherwise not be +// available in C++. +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif + #include #define BINPAC_ASSERT(x) assert(x)