Ensure __STDC_FORMAT_MACROS is always defined first

The client/common.h file defines __STDC_FORMAT_MACROS before
including inttypes.h so that the PRI* macros get defined in
C++. This is ignoring the possibility that other global
includes may have already pulled in inttypes.h

We need __STDC_FORMAT_MACROS to be defined before any header
files are included. Putting it in config.h satisfies this,
since config.h is always the first header
This commit is contained in:
Daniel P. Berrange 2012-04-25 15:17:45 +01:00
parent 5e15aa74c6
commit 91210c671f
2 changed files with 2 additions and 1 deletions

View File

@ -26,7 +26,6 @@
#include <errno.h>
#endif
#define __STDC_FORMAT_MACROS
#ifndef _WIN32
#include <inttypes.h>
#endif

View File

@ -31,6 +31,8 @@ AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([execinfo.h])
AC_FUNC_ALLOCA
AC_DEFINE([__STDC_FORMAT_MACROS],[],[Force definition of format macros for C++])
SPICE_LT_VERSION=m4_format("%d:%d:%d", 1, 0, 2)
AC_SUBST(SPICE_LT_VERSION)