diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-04-22 02:13:44 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-04-22 02:13:44 +0000 |
commit | f50bcf93171c4a73a513e04b91d6c9c8824c42ba (patch) | |
tree | 660cfcc20c9f3eb30cdfc13520b4cb2f40c39931 /time.c | |
parent | 8da932fe46bad40937605633605dd61fd16fcde5 (diff) | |
download | ruby-f50bcf93171c4a73a513e04b91d6c9c8824c42ba.tar.gz |
* 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
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |