ruby-changes:11619
From: usa <ko1@a...>
Date: Wed, 22 Apr 2009 11:13:59 +0900 (JST)
Subject: [ruby-changes:11619] Ruby:r23256 (trunk): * time.c (GMTIME, LOCALTIME): should set result if not have *_r().
usa 2009-04-22 11:13:44 +0900 (Wed, 22 Apr 2009) New Revision: 23256 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23256 Log: * time.c (GMTIME, LOCALTIME): should set result if not have *_r(). * time.c (localtime_with_gmtoff): now always needed tmbuf. Modified files: trunk/ChangeLog trunk/time.c Index: time.c =================================================================== --- time.c (revision 23255) +++ time.c (revision 23256) @@ -73,8 +73,8 @@ #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 @@ #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) Index: ChangeLog =================================================================== --- ChangeLog (revision 23255) +++ ChangeLog (revision 23256) @@ -1,3 +1,9 @@ +Wed Apr 22 11:12:15 2009 NAKAMURA Usaku <usa@r...> + + * 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@r...> * dir.c (glob_helper): C99(gcc)-ism. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/