Define __STDC_FORMAT_MACROS for C++'s inttypes.
#include <sys/socket.h>
#endif
+#if APR_HAVE_STDINT_H
#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS)
/* C99 7.18.4 requires that stdint.h only exposes INT64_C
* and UINT64_C for C++ implementations if this is defined: */
#define __STDC_CONSTANT_MACROS
#endif
-
-#if APR_HAVE_STDINT_H
#include <stdint.h>
#endif
#if APR_HAVE_INTTYPES_H
+#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
+/* C++ may need this for PRI*NN formats: */
+#define __STDC_FORMAT_MACROS
+#endif
#include <inttypes.h>
#endif
