diff options
author | bjh <bjh@13f79535-47bb-0310-9956-ffa450edef68> | 2001-04-17 02:20:19 +0000 |
---|---|---|
committer | bjh <bjh@13f79535-47bb-0310-9956-ffa450edef68> | 2001-04-17 02:20:19 +0000 |
commit | 30221037388bfd943a6a06233373092ddfad2e8b (patch) | |
tree | 65f89518b2e31f2020050733d3be4cd6d3572d21 /time/unix | |
parent | 9b4f3859225ddd9be1563d5455672c9b287edf3d (diff) | |
download | libapr-30221037388bfd943a6a06233373092ddfad2e8b.tar.gz |
Fix OS/2 build where we have no gmtime_r (or an *_r's for that matter) or
tm_gmtoff.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61524 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'time/unix')
-rw-r--r-- | time/unix/time.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/time/unix/time.c b/time/unix/time.c index c399f56d3..32930db8e 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -95,7 +95,11 @@ static void set_xt_gmtoff_from_tm(apr_exploded_time_t *xt, struct tm *tm, { struct tm t; int days = 0, hours = 0, minutes = 0; +#ifdef HAVE_GMTIME_R gmtime_r(tt, &t); +#else + t = *gmtime(tt); +#endif days = xt->tm_yday - t.tm_yday; hours = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) + xt->tm_hour - t.tm_hour); @@ -145,6 +149,10 @@ apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) { +#if defined(__EMX__) + /* EMX gcc (OS/2) has a timezone global we can use */ + return apr_explode_time(result, input, -timezone); +#else time_t mango = input / APR_USEC_PER_SEC; apr_int32_t offs = 0; @@ -163,6 +171,7 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input offs = mangotm->tm_gmtoff; #endif return apr_explode_time(result, input, offs); +#endif /* __EMX__ */ } apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) @@ -246,7 +255,7 @@ void apr_sleep(apr_interval_time_t t) { #ifdef OS2 DosSleep(t/1000); -#elseif defined(BEOS) +#elif defined(BEOS) snooze(t); #else struct timeval tv; |