mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* missing/strftime.c: HP-UX support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d37e836a58
commit
f9833b7d5f
2 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Nov 13 14:39:11 2001 WATANABE Tetsuya <tetsu@jpn.hp.com>
|
||||
|
||||
* missing/strftime.c: HP-UX support.
|
||||
|
||||
Tue Mar 4 15:08:08 2003 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||
|
||||
* configure.in: better HP-UX support.
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue