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.
This commit is contained in:
Jon Siwek 2014-02-18 15:42:36 -06:00 committed by Tim Wojtulewicz
parent a5fb8e3787
commit 498a5314ed

View file

@ -17,6 +17,13 @@
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>
#include <memory> #include <memory>
// Expose C99 functionality from inttypes.h, which would otherwise not be
// available in C++.
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h> #include <inttypes.h>
#define BINPAC_ASSERT(x) assert(x) #define BINPAC_ASSERT(x) assert(x)