1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
naruse 2015-04-23 19:51:18 +00:00
parent 692e595997
commit 1e4172467f
4 changed files with 33 additions and 4 deletions

View file

@ -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

4
time.c
View file

@ -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

View file

@ -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

View file

@ -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