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: acconfig.h
===================================================================
RCS file: /home/cvspublic/apr/acconfig.h,v
retrieving revision 1.40
diff -u -r1.40 acconfig.h
--- acconfig.h  2001/04/03 00:41:03     1.40
+++ acconfig.h  2001/04/03 20:50:27
@@ -13,6 +13,7 @@
 #undef HAVE_POLLIN
 #undef HAVE_isascii
 #undef HAVE_SO_ACCEPT_FILTER
+#undef HAVE_INT64_C
 
 /* Cross process serialization techniques */
 #undef USE_FLOCK_SERIALIZE
Index: configure.in
===================================================================
RCS file: /home/cvspublic/apr/configure.in,v
retrieving revision 1.273
diff -u -r1.273 configure.in
--- configure.in        2001/04/03 01:45:51     1.273
+++ configure.in        2001/04/03 20:50:29
@@ -812,6 +812,7 @@
 APR_CHECK_DEFINE(LOCK_EX, sys/file.h)
 APR_CHECK_DEFINE(F_SETLK, fcntl.h)
 APR_CHECK_DEFINE(CODESET, langinfo.h)
+APR_CHECK_DEFINE(INT64_C, stdint.h)
 
 # We are assuming that if the platform doesn't have POLLIN, it doesn't have
 # any POLL definitions.
Index: include/apr.h.in
===================================================================
RCS file: /home/cvspublic/apr/include/apr.h.in,v
retrieving revision 1.77
diff -u -r1.77 include/apr.h.in
--- include/apr.h.in    2001/04/03 01:09:49     1.77
+++ include/apr.h.in    2001/04/03 21:03:24
@@ -167,13 +167,16 @@
 
 /* Mechanisms to properly type numeric literals */
 
-/* XXX: this is wrong -- the LL is only required if int64 is implemented as
- * a long long, it could be just a long on some platforms.  the C99
- * correct way of doing this is to use INT64_C(1000000) which comes
- * 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
+/* INT64_C should be defined in stdint.h ; if it's not, we'll assume we
+ * should use LL (though that is only required if int64 is implemented as a
+ * long long).
  */
+#ifndef HAVE_INT64_C
 #define APR_INT64_C(val) (val##LL)
+#else
+#include <stdint.h>
+#define APR_INT64_C(val) (INT64_C(val))
+#endif
 
 
 /* Definitions that APR programs need to work properly. */

Reply via email to