mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* time.c (GMTIME, LOCALTIME): should set result if not have *_r().
* time.c (localtime_with_gmtoff): now always needed tmbuf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8da932fe46
commit
f50bcf9317
2 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
Wed Apr 22 11:12:15 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* time.c (GMTIME, LOCALTIME): should set result if not have *_r().
|
||||
|
||||
* time.c (localtime_with_gmtoff): now always needed tmbuf.
|
||||
|
||||
Wed Apr 22 10:38:47 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* dir.c (glob_helper): C99(gcc)-ism.
|
||||
|
|
6
time.c
6
time.c
|
@ -73,8 +73,8 @@ static int leap_year_p(long y);
|
|||
#else
|
||||
#define IF_HAVE_GMTIME_R(x) /* nothing */
|
||||
#define ASCTIME(tm, buf) asctime(tm)
|
||||
#define GMTIME(tm, result) gmtime(tm)
|
||||
#define LOCALTIME(tm, result) localtime(tm)
|
||||
#define GMTIME(tm, result) (result = *gmtime(tm), &result)
|
||||
#define LOCALTIME(tm, result) (result = *localtime(tm), &result)
|
||||
#endif
|
||||
|
||||
static ID id_divmod, id_mul, id_submicro, id_subnano;
|
||||
|
@ -908,7 +908,7 @@ localtime_with_gmtoff(const time_t *t, struct tm *result, long *gmtoff)
|
|||
#else
|
||||
struct tm *u, *l;
|
||||
long off;
|
||||
IF_HAVE_GMTIME_R(struct tm tmbuf);
|
||||
struct tm tmbuf;
|
||||
l = &tm;
|
||||
u = GMTIME(t, tmbuf);
|
||||
if (!u)
|
||||
|
|
Loading…
Reference in a new issue