From: nobu@... Date: 2020-04-08T03:27:22+00:00 Subject: [ruby-core:97744] [Ruby master Feature#16763] MSVC: allow ranges for MSVC 2017 and 2019 support in win32/Makefile.sub Issue #16763 has been updated by nobu (Nobuyoshi Nakada). Description updated 1. Are they completely binary compatible? 2. Only the last digit changes? If it is expected from now on, I prefer to avoid hardcoding the list in Makefile.sub. --- ```diff diff --git c/win32/Makefile.sub w/win32/Makefile.sub index 328f3479aa..ebe741d2e0 100644 --- c/win32/Makefile.sub +++ w/win32/Makefile.sub @@ -607,9 +607,15 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub @$(IFCHANGE) "--timestamp=$(@:/=\)" $(RUBY_CONFIG_H:/=\) << #ifndef $(guard) #define $(guard) 1 +!ifdef MSC_VER_RANGE +#if (_MSC_VER / 10) != ($(MSC_VER) / 10) +#error MSC version unmatch: $(MSC_VER_RANGE) is expected. +#endif +!else #if _MSC_VER != $(MSC_VER) -#error MSC version unmatch: _MSC_VER: $(MSC_VER) is expected. +#error MSC version unmatch: $(MSC_VER) is expected. #endif +!endif #define RUBY_MSVCRT_VERSION $(RT_VER) #define STDC_HEADERS 1 #define HAVE_SYS_TYPES_H 1 diff --git c/win32/setup.mak w/win32/setup.mak index d67b6843a4..5cbbf12560 100644 --- c/win32/setup.mak +++ w/win32/setup.mak @@ -132,9 +132,6 @@ int main(void) {return (EnumProcesses(NULL,0,NULL) ? 0 : 1);} << -version-: nul verconf.mk - @$(CPP) -I$(srcdir) -I$(srcdir)/include <<"Creating $(MAKEFILE)" | findstr "=" >>$(MAKEFILE) -MSC_VER = _MSC_VER -<< verconf.mk: nul @$(CPP) -I$(srcdir) -I$(srcdir)/include <<"Creating $(@)" > $(*F).bat && cmd /c $(*F).bat > $(@) @@ -152,6 +149,11 @@ echo TEENY = RUBY_VERSION_TEENY #if defined RUBY_PATCHLEVEL && RUBY_PATCHLEVEL < 0 echo RUBY_DEVEL = yes #endif +echo MSC_VER = _MSC_VER +#if _MSC_VER > 1900 +set /a v=_MSC_VER/10 +echo MSC_VER_RANGE = %v%0..%v%9 +#endif del %0 & exit << ``` ---------------------------------------- Feature #16763: MSVC: allow ranges for MSVC 2017 and 2019 support in win32/Makefile.sub https://bugs.ruby-lang.org/issues/16763#change-84956 * Author: jmarrec (Julien Marrec) * Status: Open * Priority: Normal ---------------------------------------- `_MSC_VER` differs from previous version in 2017 and 2019, in the sense that updates have their own last digit changing. For a list of `_MSC_VER` see for example https://dev.to/yumetodo/list-of-mscver-and-mscfullver-8nd config.h ends up having harcoded version (eg: 1924), which is overly strict (today I updated to MSVC update 16.5.1 and suddenly my build which links to and embeds ruby broke). The proposed patch adds ranges for these version. ---Files-------------------------------- 0001-patch-to-support-version-ranges-for-MSVC.patch (1.08 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: