diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2001-04-02 19:00:32 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2001-04-02 19:00:32 +0000 |
commit | f83659cf1ec26f6f42e2b79c0ea954c4746c8e14 (patch) | |
tree | e7530a77f218f6109782d7997d2dce2c1163b4e1 /include/apr_time.h | |
parent | ab49e45249aea801d4fae900c10703b800de8bcd (diff) | |
download | libapr-f83659cf1ec26f6f42e2b79c0ea954c4746c8e14.tar.gz |
Anyone up for writing a bit of proper autoconf magic :-?
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61427 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_time.h')
-rw-r--r-- | include/apr_time.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/include/apr_time.h b/include/apr_time.h index 07b72670e..45ec56448 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -70,24 +70,21 @@ extern "C" { 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_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, 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) |