diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-04 09:16:17 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-04 09:16:17 +0000 |
commit | db694b2183c3c42c64cca32861fd1780e802276c (patch) | |
tree | 4ce71f73eae0e08acd2abd9970ef15512dd5c2b4 /missing | |
parent | d1d578775b2d8eeab28fab3375113280d720c204 (diff) | |
download | ruby-db694b2183c3c42c64cca32861fd1780e802276c.tar.gz ruby-db694b2183c3c42c64cca32861fd1780e802276c.tar.xz ruby-db694b2183c3c42c64cca32861fd1780e802276c.zip |
* missing/strftime.c: HP-UX support.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r-- | missing/strftime.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/missing/strftime.c b/missing/strftime.c index 02fdc5ade..5522226ec 100644 --- a/missing/strftime.c +++ b/missing/strftime.c @@ -118,12 +118,16 @@ extern char *strchr(); #if !defined(OS2) && !defined(MSDOS) && defined(HAVE_TZNAME) extern char *tzname[2]; extern int daylight; -#if defined SOLARIS || defined __hpux +#ifdef SOLARIS extern long timezone, altzone; #else +#ifdef __hpux +extern long timezone; +#else extern int timezone, altzone; #endif #endif +#endif #undef min /* just in case */ @@ -189,6 +193,11 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr) extern char *timezone(); struct timeval tv; struct timezone zone; +#else +#ifdef __hpux + struct timeval tv; + struct timezone zone; +#endif #endif /* HAVE_TZNAME */ #endif /* HAVE_TM_NAME */ #endif /* HAVE_TM_ZONE */ @@ -418,7 +427,12 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr) * Systems with tzname[] probably have timezone as * secs west of GMT. Convert to mins east of GMT. */ +#ifdef __hpux + gettimeofday(&tv, &zone); + off = -zone.tz_minuteswest; +#else off = -(daylight ? timezone : altzone) / 60; +#endif #else /* !HAVE_TZNAME */ gettimeofday(&tv, &zone); off = -zone.tz_minuteswest; |