From 4705ebd907343cf635cbd9288503653fccf61f0f Mon Sep 17 00:00:00 2001 From: "xtkoba (Tee KOBAYASHI)" Date: Mon, 21 Jun 2021 14:41:25 +0200 Subject: [PATCH] MINGW: Fix build error on Windows UCRT --- win32/win32.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/win32/win32.c b/win32/win32.c index 5640316b0f..b0e43ed45f 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -887,6 +887,13 @@ socklist_delete(SOCKET *sockp, int *flagp) return ret; } +#if RUBY_MSVCRT_VERSION >= 80 +# ifdef __MINGW32__ +# define _CrtSetReportMode(type,mode) ((void)0) +# define _RTC_SetErrorFunc(func) ((void)0) +# endif +static void set_pioinfo_extra(void); +#endif static int w32_cmdvector(const WCHAR *, char ***, UINT, rb_encoding *); // // Initialization stuff @@ -896,7 +903,6 @@ void rb_w32_sysinit(int *argc, char ***argv) { #if RUBY_MSVCRT_VERSION >= 80 - static void set_pioinfo_extra(void); _CrtSetReportMode(_CRT_ASSERT, 0); _set_invalid_parameter_handler(invalid_parameter);