summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2019-03-22 12:49:15 +0000
committerYann Ylavic <ylavic@apache.org>2019-03-22 12:49:15 +0000
commit2b211a468ddc4c06de35e94374542fb31edd30f6 (patch)
tree5efe0506906932302720a13ca730d16616c9404f
parentda195e8db0e7c52da2225e256d381c15396d9b5c (diff)
downloadapr-2b211a468ddc4c06de35e94374542fb31edd30f6.tar.gz
Define __STDC_FORMAT_MACROS for C++'s inttypes.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1856046 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/apr.h.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/apr.h.in b/include/apr.h.in
index e7193d77b..17e34a616 100644
--- a/include/apr.h.in
+++ b/include/apr.h.in
@@ -187,17 +187,20 @@
#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