On Fri, Mar 22, 2019 at 11:55:27AM +0000, Yann Ylavic wrote:
> On Fri, Mar 22, 2019 at 9:45 AM Yann Ylavic <ylavic....@gmail.com> wrote:
> > Both apr_time_t and apr_interval_time_t are (apr_)int64_t, which is
> > probably format "%lld" on OpenBSD, so we'd need to determine
> > APR_INT64_T (and all of our numeric _FMT) with
> > APR_CHECK_TYPES_FMT_COMPATIBLE too.
> 
> So what about r1856042? Stefan, works for you (this is trunk only for now)?

Yes, thank you! Looks much better.

Here's diff between generated apr.h from before and after r1856042
on OpenBSD/amd64.

--- /tmp/apr.h-before   Fri Mar 22 13:25:53 2019
+++ include/apr.h       Fri Mar 22 13:28:04 2019
@@ -96,6 +96,7 @@
 #define APR_HAVE_STDLIB_H        1
 #define APR_HAVE_STRING_H        1
 #define APR_HAVE_STRINGS_H       1
+#define APR_HAVE_INTTYPES_H      1
 #define APR_HAVE_SYS_IOCTL_H     1
 #define APR_HAVE_SYS_SENDFILE_H  0
 #define APR_HAVE_SYS_SIGNAL_H    1
@@ -196,6 +197,10 @@
 #include <stdint.h>
 #endif
 
+#if APR_HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
 #if APR_HAVE_SYS_WAIT_H
 #include <sys/wait.h>
 #endif
@@ -376,8 +381,8 @@
  #define UINT64_C(v)  (v ## ULL)
 #endif
 #else
- typedef  long            apr_int64_t;
- typedef  unsigned long   apr_uint64_t;
+ typedef  int64_t           apr_int64_t;
+ typedef  uint64_t          apr_uint64_t;
 #endif
 
 typedef  size_t          apr_size_t;
@@ -586,19 +591,19 @@
 #define APR_SIZE_T_FMT "lu"
 
 /* And APR_OFF_T_FMT */
-#define APR_OFF_T_FMT "ld"
+#define APR_OFF_T_FMT "lld"
 
 /* And APR_PID_T_FMT */
 #define APR_PID_T_FMT "d"
 
 /* And APR_INT64_T_FMT */
-#define APR_INT64_T_FMT "ld"
+#define APR_INT64_T_FMT PRId64
 
 /* And APR_UINT64_T_FMT */
-#define APR_UINT64_T_FMT "lu"
+#define APR_UINT64_T_FMT PRIu64
 
 /* And APR_UINT64_T_HEX_FMT */
-#define APR_UINT64_T_HEX_FMT "lx"
+#define APR_UINT64_T_HEX_FMT PRIx64
 
 /*
  * Ensure we work with universal binaries on Darwin

Reply via email to