|
| 1 | +diff --git a/configure.ac b/configure.ac |
| 2 | +index fa62b5fa85..a563115033 100644 |
| 3 | +--- a/configure.ac |
| 4 | ++++ b/configure.ac |
| 5 | +@@ -443,10 +443,15 @@ AS_CASE(["$target_os"], |
| 6 | + [[FILE* volatile f = stdin; return 0;]])], |
| 7 | + [rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext | |
| 8 | + tr A-Z a-z | |
| 9 | +- sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`], |
| 10 | ++ sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'` |
| 11 | ++ test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext | |
| 12 | ++ tr A-Z a-z | |
| 13 | ++ sed -n '/^[[ ]]*dll name: \(api-ms-win-crt.*\)\.dll$/{s//ucrt/p;q;}'` |
| 14 | ++ test "$rb_cv_msvcrt" = "ucrt" && RT_VER=140 |
| 15 | ++ ], |
| 16 | + [rb_cv_msvcrt=msvcrt]) |
| 17 | + test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt]) |
| 18 | +- RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]` |
| 19 | ++ test "$RT_VER" = "" && RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]` |
| 20 | + test "$RT_VER" = "" && RT_VER=60 |
| 21 | + AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER) |
| 22 | + sysconfdir= |
| 23 | +diff --git a/win32/win32.c b/win32/win32.c |
| 24 | +index 940a85a4de..b7fcd666f1 100644 |
| 25 | +--- a/win32/win32.c |
| 26 | ++++ b/win32/win32.c |
| 27 | +@@ -888,6 +888,12 @@ socklist_delete(SOCKET *sockp, int *flagp) |
| 28 | + } |
| 29 | + |
| 30 | + static int w32_cmdvector(const WCHAR *, char ***, UINT, rb_encoding *); |
| 31 | ++ |
| 32 | ++#if RUBY_MSVCRT_VERSION >= 80 |
| 33 | ++#include <crtdbg.h> |
| 34 | ++static void set_pioinfo_extra(void); |
| 35 | ++#endif |
| 36 | ++ |
| 37 | + // |
| 38 | + // Initialization stuff |
| 39 | + // |
| 40 | +@@ -896,11 +902,11 @@ void |
| 41 | + rb_w32_sysinit(int *argc, char ***argv) |
| 42 | + { |
| 43 | + #if RUBY_MSVCRT_VERSION >= 80 |
| 44 | +- static void set_pioinfo_extra(void); |
| 45 | +- |
| 46 | + _CrtSetReportMode(_CRT_ASSERT, 0); |
| 47 | + _set_invalid_parameter_handler(invalid_parameter); |
| 48 | ++#if !defined(__MINGW32__) |
| 49 | + _RTC_SetErrorFunc(rtc_error_handler); |
| 50 | ++#endif |
| 51 | + set_pioinfo_extra(); |
| 52 | + #endif |
| 53 | + SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOGPFAULTERRORBOX); |
0 commit comments