summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2019-03-22 12:49:15 +0000
committerylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2019-03-22 12:49:15 +0000
commitd4be4d640dba8740289a11bd68391884d3bf342d (patch)
tree5efe0506906932302720a13ca730d16616c9404f
parent71eacc9b073111d660394d15263895204c1ce349 (diff)
downloadlibapr-d4be4d640dba8740289a11bd68391884d3bf342d.tar.gz
Define __STDC_FORMAT_MACROS for C++'s inttypes.
git-svn-id: http://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