wrowe 01/04/02 12:00:34
Modified: include apr.h.in apr.hw apr_time.h
Log:
Anyone up for writing a bit of proper autoconf magic :-?
Revision Changes Path
1.76 +12 -0 apr/include/apr.h.in
Index: apr.h.in
===================================================================
RCS file: /home/cvs/apr/include/apr.h.in,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- apr.h.in 2001/03/11 23:24:56 1.75
+++ apr.h.in 2001/04/02 19:00:31 1.76
@@ -163,6 +163,18 @@
typedef @off_t_value@ apr_off_t;
typedef @socklen_t_value@ apr_socklen_t;
+
+/* 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
+ */
+#define APR_INT64_C(val) (val##LL)
+
+
/* Definitions that APR programs need to work properly. */
#define APR_THREAD_FUNC
1.58 +6 -0 apr/include/apr.hw
Index: apr.hw
===================================================================
RCS file: /home/cvs/apr/include/apr.hw,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- apr.hw 2001/03/01 13:41:46 1.57
+++ apr.hw 2001/04/02 19:00:31 1.58
@@ -222,6 +222,12 @@
typedef int uid_t;
typedef int gid_t;
+
+/* Mechanisms to properly type numeric literals */
+
+#define APR_INT64_C(val) (val##i64)
+
+
/* Definitions that APR programs need to work properly. */
#define APR_THREAD_FUNC __stdcall
1.34 +10 -13 apr/include/apr_time.h
Index: apr_time.h
===================================================================
RCS file: /home/cvs/apr/include/apr_time.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- apr_time.h 2001/02/16 04:15:47 1.33
+++ apr_time.h 2001/04/02 19:00:32 1.34
@@ -70,24 +70,21 @@
extern APR_DECLARE_DATA const char apr_month_snames[12][4];
extern APR_DECLARE_DATA const char apr_day_snames[7][4];
+
/* number of microseconds since 00:00:00 january 1, 1970 UTC */
typedef apr_int64_t apr_time_t;
+
+/* mechanism to properly type apr_time_t literals */
+#define APR_TIME_C(val) APR_INT64_C(val)
+
+
/* intervals for I/O timeouts, in microseconds */
typedef apr_int64_t apr_interval_time_t;
typedef apr_int32_t apr_short_interval_time_t;
-#ifdef WIN32
-#define APR_USEC_PER_SEC ((LONGLONG) 1000000)
-#else
-/* 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
- */
-#define APR_USEC_PER_SEC (1000000LL)
-#endif
+#define APR_USEC_PER_SEC APR_TIME_C(1000000)
+
/**
* return the current time
@@ -154,8 +151,8 @@
apr_time_t input);
/**
- * Convert time value from human readable format to number of seconds
- * since epoch
+ * Convert time value from human readable format to a numeric apr_time_t
+ * e.g. elapsed usec since epoch
* @param result the resulting imploded time
* @param input the input exploded time
* @deffunc apr_status_t apr_implode_time(apr_time_t *result,
apr_exploded_time_t *input)