From 1e4172467f258b313da683489a714c91f103d84d Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 23 Apr 2015 19:51:18 +0000 Subject: * win32/Makefile.sub: MSVC14 have struct timespec. * win32/rtname.cmd: support vcruntime140.dll. * time.c (localtime_with_gmtoff_zone): MSVC14 doesn't have tzname and daylight but have _tzname and _daylight. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++++ time.c | 4 ++++ win32/Makefile.sub | 3 +++ win32/rtname.cmd | 21 +++++++++++++++++---- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24b19ed984..2fe565b730 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Fri Apr 24 04:49:05 2015 NARUSE, Yui + + * win32/Makefile.sub: MSVC14 have struct timespec. + + * win32/rtname.cmd: support vcruntime140.dll. + + * time.c (localtime_with_gmtoff_zone): MSVC14 doesn't have tzname and + daylight but have _tzname and _daylight. + Thu Apr 23 11:35:55 2015 Nobuyoshi Nakada * vm_eval.c (rb_obj_instance_eval, rb_obj_instance_exec): allow diff --git a/time.c b/time.c index 4af193d19a..382dc3f108 100644 --- a/time.c +++ b/time.c @@ -1639,6 +1639,10 @@ localtime_with_gmtoff_zone(const time_t *t, struct tm *result, long *gmtoff, con else *zone = zone_str("(NO-TIMEZONE-ABBREVIATION)"); #elif defined(HAVE_TZNAME) && defined(HAVE_DAYLIGHT) +# if RUBY_MSVCRT_VERSION >= 140 +# define tzname _tzname +# define daylight _daylight +# endif /* this needs tzset or localtime, instead of localtime_r */ *zone = zone_str(tzname[daylight && tm.tm_isdst]); #else diff --git a/win32/Makefile.sub b/win32/Makefile.sub index b8bd25bd31..e2d9d6159f 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -613,6 +613,9 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub #define HAVE_STRUCT_STAT_ST_RDEV 1 #define HAVE_ST_RDEV 1 #define HAVE_STRUCT_TIMEVAL 1 +!if $(MSC_VER) >= 1900 +#define HAVE_STRUCT_TIMESPEC +!endif !if $(MSC_VER) >= 1600 #define HAVE_STDINT_H 1 !else diff --git a/win32/rtname.cmd b/win32/rtname.cmd index 1f410a02db..f7a52b8a9d 100644 --- a/win32/rtname.cmd +++ b/win32/rtname.cmd @@ -3,10 +3,14 @@ set rt= set rtver= set osver= for /f "usebackq" %%I in (`dumpbin -dependents %1 ^| findstr -r -i "\&2 - exit 1 -) +if "%rt%" NEQ "" goto :msvcr +for /f "usebackq" %%I in (`dumpbin -dependents %1 ^| findstr -r -i "\&2 +exit 1 + +:msvcr for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @call set rt=%%rt:%%i=%%i%% if "%rt%" == "msvcrt" ( call set rtver=60 @@ -15,4 +19,13 @@ if "%rt%" == "msvcrt" ( call set rt=msvcr%%rtver%% call set osver=_%%rtver%% ) +goto :exit + +:vcruntime +for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @call set rt=%%rt:%%i=%%i%% +call set rtver=%%rt:vcruntime=%% +call set rt=vcruntime%%rtver%% +call set osver=_%%rtver%% + +:exit for %%I in ("PLATFORM = $(TARGET_OS)%osver%" "RT = %rt%" "RT_VER = %rtver%") do @echo %%~I -- cgit v1.2.3