2000-06-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
548b5143db
commit
c86f2148a2
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
Mon Jun 12 23:41:54 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
|
||||||
|
|
||||||
|
* configure.in (daylight): avoid GCC optimization.
|
||||||
|
|
||||||
|
Mon Jun 12 19:02:27 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
|
||||||
|
|
||||||
|
* configure.in: cygwin has strange timezone.
|
||||||
|
|
||||||
|
* time.c (time_zone): use tzname and daylight.
|
||||||
|
|
||||||
Sat Jun 10 23:10:32 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
Sat Jun 10 23:10:32 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||||
|
|
||||||
* io.c (rb_io_seek): whence is optional, default is SEEK_SET.
|
* io.c (rb_io_seek): whence is optional, default is SEEK_SET.
|
||||||
|
@ -157,7 +157,7 @@ openstep*) ;;
|
|||||||
rhapsody*) ;;
|
rhapsody*) ;;
|
||||||
human*) ac_cv_func_getpgrp_void=yes;;
|
human*) ac_cv_func_getpgrp_void=yes;;
|
||||||
beos*) ;;
|
beos*) ;;
|
||||||
cygwin*) ;;
|
cygwin*) rb_cv_have_daylight=no;;
|
||||||
mingw*) LIBS="-lwsock32 -lmsvcrt $LIBS"
|
mingw*) LIBS="-lwsock32 -lmsvcrt $LIBS"
|
||||||
ac_cv_header_a_out_h=no
|
ac_cv_header_a_out_h=no
|
||||||
ac_cv_header_pwd_h=no
|
ac_cv_header_pwd_h=no
|
||||||
@ -211,7 +211,7 @@ AC_CHECK_FUNCS(fmod killpg drand48 random wait4 waitpid syscall getcwd\
|
|||||||
AC_STRUCT_TIMEZONE
|
AC_STRUCT_TIMEZONE
|
||||||
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
|
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
|
||||||
[AC_TRY_LINK([],
|
[AC_TRY_LINK([],
|
||||||
[extern int daylight; int i = daylight;],
|
[extern int daylight; daylight++;],
|
||||||
rb_cv_have_daylight=yes,
|
rb_cv_have_daylight=yes,
|
||||||
rb_cv_have_daylight=no)])
|
rb_cv_have_daylight=no)])
|
||||||
if test "$rb_cv_have_daylight" = yes; then
|
if test "$rb_cv_have_daylight" = yes; then
|
||||||
|
12
time.c
12
time.c
@ -272,6 +272,11 @@ static VALUE time_gmtime _((VALUE));
|
|||||||
static VALUE time_localtime _((VALUE));
|
static VALUE time_localtime _((VALUE));
|
||||||
static VALUE time_get_tm _((VALUE, int));
|
static VALUE time_get_tm _((VALUE, int));
|
||||||
|
|
||||||
|
#if defined(HAVE_DAYLIGHT) && !defined __MINGW32__
|
||||||
|
extern int daylight;
|
||||||
|
extern long timezone;
|
||||||
|
#endif
|
||||||
|
|
||||||
static time_t
|
static time_t
|
||||||
make_time_t(tptr, utc_or_local)
|
make_time_t(tptr, utc_or_local)
|
||||||
struct tm *tptr;
|
struct tm *tptr;
|
||||||
@ -313,9 +318,6 @@ make_time_t(tptr, utc_or_local)
|
|||||||
|
|
||||||
if (!utc_or_local) { /* localtime zone adjust */
|
if (!utc_or_local) { /* localtime zone adjust */
|
||||||
#if defined(HAVE_DAYLIGHT)
|
#if defined(HAVE_DAYLIGHT)
|
||||||
extern int daylight;
|
|
||||||
extern long timezone;
|
|
||||||
|
|
||||||
localtime(&guess);
|
localtime(&guess);
|
||||||
guess += timezone + daylight;
|
guess += timezone + daylight;
|
||||||
#else
|
#else
|
||||||
@ -807,8 +809,8 @@ time_zone(time)
|
|||||||
time_get_tm(time, tobj->gmt);
|
time_get_tm(time, tobj->gmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_TZNAME
|
#if defined HAVE_TZNAME && defined HAVE_DAYLIGHT
|
||||||
return rb_str_new2(tobj->tm.tm_zone);
|
return rb_str_new2(tzname[daylight && tobj->tm.tm_isdst]);
|
||||||
#else
|
#else
|
||||||
len = strftime(buf, 64, "%Z", &tobj->tm);
|
len = strftime(buf, 64, "%Z", &tobj->tm);
|
||||||
return rb_str_new(buf, len);
|
return rb_str_new(buf, len);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user