You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2019/03/22 13:18:36 UTC

svn commit: r1856050 - /apr/apr/trunk/include/apr.h.in

Author: ylavic
Date: Fri Mar 22 13:18:36 2019
New Revision: 1856050

URL: http://svn.apache.org/viewvc?rev=1856050&view=rev
Log:
stdint.h and inttypes.h may include each other so define __STDC macros first.

Modified:
    apr/apr/trunk/include/apr.h.in

Modified: apr/apr/trunk/include/apr.h.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.h.in?rev=1856050&r1=1856049&r2=1856050&view=diff
==============================================================================
--- apr/apr/trunk/include/apr.h.in (original)
+++ apr/apr/trunk/include/apr.h.in Fri Mar 22 13:18:36 2019
@@ -188,19 +188,21 @@
 #endif
 
 #if APR_HAVE_STDINT_H
-#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS)
+#ifdef __cplusplus
 /* C99 7.18.4 requires that stdint.h only exposes INT64_C 
  * and UINT64_C for C++ implementations if this is defined: */
+#ifndef __STDC_CONSTANT_MACROS
 #define __STDC_CONSTANT_MACROS
 #endif
+/* C++ needs this too for PRI*NN formats: */
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS
+#endif
+#endif /* __cplusplus */
 #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