Here's an alternative, don't much mind which way we go with this.
It resolves a bigger issue, the APR_INT64_T_FMT of "????" :-)
This only affects test/testtime.c right now
Bill
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, April 03, 2001 2:56 PM
Subject: [PATCH] create INT64_C autoconf test
> After some fun with buildconf dependencies, I noticed a note from Dean
> about how we should really use INT64_C when it's available. I've looked
> at autoconf before, but I don't claim expertise with it; it'd probably
> be good to have someone who knows autoconf review it. It's lightly
> tested on linux and freebsd.
>
> It'd be nice to insist that buildconf be run when needed. This came up
> in particular for apr.h.in -- but when I took a look at it, I realized
> that it should be done for other files as well. I'll look into doing
> that later ...
>
> thanks --
>
> Ed
>
Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.275
diff -u -r1.275 configure.in
--- configure.in 2001/04/03 20:57:44 1.275
+++ configure.in 2001/04/03 22:54:22
@@ -584,20 +584,40 @@
if test "$ac_cv_sizeof_int" = "4"; then
int_value=int
fi
+if test "$ac_cv_sizeof_int" = "8"; then
+ int64_literal='#define APR_INT64_C(val) (val)'
+ int64_t_fmt='#define APR_INT64_T_FMT "d"'
+ int64_value="int"
+fi
if test "$ac_cv_sizeof_long" = "8"; then
+ int64_literal='#define APR_INT64_C(val) (val##L)'
+ int64_t_fmt='#define APR_INT64_T_FMT "ld"'
+ int64_value="long"
long_value=long
fi
if test "$ac_cv_sizeof_long_double" = "8"; then
+ int64_literal='#define APR_INT64_C(val) (val##LD)'
+ int64_t_fmt='#define APR_INT64_T_FMT "Ld"'
+ int64_value="long double"
long_value="long double"
fi
if test "$ac_cv_sizeof_long_long" = "8"; then
if test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_long"; then
+ int64_literal='#define APR_INT64_C(val) (val##L)'
+ int64_t_fmt='#define APR_INT64_T_FMT "ld"'
+ int64_value="long"
long_value="long"
else
+ int64_literal='#define APR_INT64_C(val) (val##LL)'
+ int64_t_fmt='#define APR_INT64_T_FMT "qd"'
+ int64_value="long long"
long_value="long long"
fi
fi
if test "$ac_cv_sizeof_longlong" = "8"; then
+ int64_literal='#define APR_INT64_C(val) (val##LL)'
+ int64_t_fmt='#define APR_INT64_T_FMT "qd"'
+ int64_value="__int64"
long_value="__int64"
fi
Index: include/apr.h.in
===================================================================
RCS file: /home/cvs/apr/include/apr.h.in,v
retrieving revision 1.77
diff -u -r1.77 apr.h.in
--- include/apr.h.in 2001/04/03 01:09:49 1.77
+++ include/apr.h.in 2001/04/03 22:54:24
@@ -173,7 +173,7 @@
* from stdint.h. we'd probably be doing a Good Thing to check for
* INT64_C in autoconf... or otherwise define an APR_INT64_C(). -dean
*/
-#define APR_INT64_C(val) (val##LL)
[EMAIL PROTECTED]@
/* Definitions that APR programs need to work properly. */
@@ -238,6 +238,11 @@
/* And APR_OS_PROC_T_FMT */
@os_proc_t_fmt@
+
+/* And APR_INT64_T_FMT */
+
+#define APR_TIME_T_FMT APR_INT64_T_FMT
+
/* Local machine definition for console and log output. */
#define APR_EOL_STR "@eolstr@"