summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-23 19:51:18 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-23 19:51:18 +0000
commit1e4172467f258b313da683489a714c91f103d84d (patch)
treeadeec3ee0ec0936861c9ee9b9321ac8d5dbdb6ab
parent692e5959977b515dcae5ce661fb10d3751b322de (diff)
* 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
-rw-r--r--ChangeLog9
-rw-r--r--time.c4
-rw-r--r--win32/Makefile.sub3
-rw-r--r--win32/rtname.cmd21
4 files changed, 33 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 24b19ed..2fe565b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Fri Apr 24 04:49:05 2015 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * 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 <nobu@ruby-lang.org>
* vm_eval.c (rb_obj_instance_eval, rb_obj_instance_exec): allow
diff --git a/time.c b/time.c
index 4af193d..382dc3f 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 b8bd25b..e2d9d61 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 1f410a0..f7a52b8 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 "\<msvcr.*\.dll$"`) do set rt=%%~nI
-if "%rt%" == "" (
- (echo %0: %1 is not linked to msvcrt) 1>&2
- exit 1
-)
+if "%rt%" NEQ "" goto :msvcr
+for /f "usebackq" %%I in (`dumpbin -dependents %1 ^| findstr -r -i "\<vcruntime.*\.dll$"`) do set rt=%%~nI
+if "%rt%" NEQ "" goto :vcruntime
+
+(echo %0: %1 is not linked to msvcrt nor vcruntime) 1>&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