ruby-changes:32695
From: naruse <ko1@a...>
Date: Fri, 31 Jan 2014 12:07:06 +0900 (JST)
Subject: [ruby-changes:32695] naruse:r44774 (ruby_2_1): merge revision(s) 44406: [Backport #9324]
naruse 2014-01-31 12:07:00 +0900 (Fri, 31 Jan 2014) New Revision: 44774 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44774 Log: merge revision(s) 44406: [Backport #9324] * configure.in: let mingw do something black-magic, and check if _gmtime64_s() is available actually. * win32/win32.c (gmtime_s, localtime_s): use _gmtime64_s() and _localtime64_s() if available, not depending on very confusing mingw variants macros. based on the patch by phasis68 (Heesob Park) at [ruby-core:58764]. [ruby-core:58391] [Bug #9119] Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/configure.in branches/ruby_2_1/version.h branches/ruby_2_1/win32/win32.c Index: ruby_2_1/configure.in =================================================================== --- ruby_2_1/configure.in (revision 44773) +++ ruby_2_1/configure.in (revision 44774) @@ -888,6 +888,7 @@ AC_ARG_WITH(winnt-ver, https://github.com/ruby/ruby/blob/trunk/ruby_2_1/configure.in#L888 AS_CASE(["$target_os"], [mingw*], [ RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver) + RUBY_APPEND_OPTION(CPPFLAGS, -D__MINGW_USE_VC2005_COMPAT) ]) AS_CASE(["$target_os"], @@ -1040,6 +1041,7 @@ main() https://github.com/ruby/ruby/blob/trunk/ruby_2_1/configure.in#L1041 if test x"$ac_cv_type_NET_LUID" = xyes; then AC_DEFINE(HAVE_TYPE_NET_LUID, 1) fi + AC_CHECK_FUNCS(_gmtime64_s) AC_LIBOBJ([langinfo]) ], [os2-emx*], [ LIBS="-lm $LIBS" Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 44773) +++ ruby_2_1/ChangeLog (revision 44774) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Fri Jan 31 12:05:59 2014 Nobuyoshi Nakada <nobu@r...> + + * configure.in: let mingw do something black-magic, and check if + _gmtime64_s() is available actually. + + * win32/win32.c (gmtime_s, localtime_s): use _gmtime64_s() and + _localtime64_s() if available, not depending on very confusing + mingw variants macros. based on the patch by phasis68 (Heesob + Park) at [ruby-core:58764]. [ruby-core:58391] [Bug #9119] + Thu Jan 30 15:02:35 2014 Shugo Maeda <shugo@r...> * configure.in: use $@ instead of $(.TARGET) because .TARGET is not Index: ruby_2_1/win32/win32.c =================================================================== --- ruby_2_1/win32/win32.c (revision 44773) +++ ruby_2_1/win32/win32.c (revision 44774) @@ -6965,7 +6965,7 @@ rb_w32_fd_is_text(int fd) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/win32/win32.c#L6965 return _osfile(fd) & FTEXT; } -#if RUBY_MSVCRT_VERSION < 80 && !defined(__MINGW64__) +#if RUBY_MSVCRT_VERSION < 80 && !defined(HAVE__GMTIME64_S) /* License: Ruby's */ static int unixtime_to_systemtime(const time_t t, SYSTEMTIME *st) @@ -7027,7 +7027,11 @@ systemtime_to_localtime(TIME_ZONE_INFORM https://github.com/ruby/ruby/blob/trunk/ruby_2_1/win32/win32.c#L7027 } #endif -#ifdef __MINGW64__ +#ifdef HAVE__GMTIME64_S +# ifndef HAVE__LOCALTIME64_S +/* assume same as _gmtime64_s() */ +# define HAVE__LOCALTIME64_S 1 +# endif # ifndef MINGW_HAS_SECURE_API _CRTIMP errno_t __cdecl _gmtime64_s(struct tm* tm, const __time64_t *time); _CRTIMP errno_t __cdecl _localtime64_s(struct tm* tm, const __time64_t *time); @@ -7046,7 +7050,7 @@ gmtime_r(const time_t *tp, struct tm *rp https://github.com/ruby/ruby/blob/trunk/ruby_2_1/win32/win32.c#L7050 errno = e; return NULL; } -#if RUBY_MSVCRT_VERSION >= 80 || defined(__MINGW64__) +#if RUBY_MSVCRT_VERSION >= 80 || defined(HAVE__GMTIME64_S) e = gmtime_s(rp, tp); if (e != 0) goto error; #else @@ -7070,7 +7074,7 @@ localtime_r(const time_t *tp, struct tm https://github.com/ruby/ruby/blob/trunk/ruby_2_1/win32/win32.c#L7074 errno = e; return NULL; } -#if RUBY_MSVCRT_VERSION >= 80 || defined(__MINGW64__) +#if RUBY_MSVCRT_VERSION >= 80 || defined(HAVE__LOCALTIME64_S) e = localtime_s(rp, tp); if (e) goto error; #else Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 44773) +++ ruby_2_1/version.h (revision 44774) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.1" -#define RUBY_RELEASE_DATE "2014-01-30" -#define RUBY_PATCHLEVEL 11 +#define RUBY_RELEASE_DATE "2014-01-31" +#define RUBY_PATCHLEVEL 12 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 1 -#define RUBY_RELEASE_DAY 30 +#define RUBY_RELEASE_DAY 31 #include "ruby/version.h" Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r44406 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/