From 78393dc1a64a0bc6d9bda8fb7b1acc2e537a2e38 Mon Sep 17 00:00:00 2001 From: Takuji Tanaka Date: Sat, 24 Jul 2021 23:04:15 +0000 Subject: web2c/lib: patch for Visual Studio 2015 (Windows only) git-svn-id: svn://tug.org/texlive/trunk@60047 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/lib/ChangeLog | 5 +++++ Build/source/texk/web2c/lib/texmfmp.c | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'Build/source/texk') diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index 96c5d0cd99f..94d845813e0 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,3 +1,8 @@ +2021-07-25 TANAKA Takuji + + * texmfmp.c: Apply patch of W32TeX for Visual Studio 2015 + by Kakuto-san. + 2021-05-18 Karl Berry * usage.c (usagehelp): if bug_email arg ends in "@tug.org" diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 1b448eb185a..20e46c6a7f3 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -1065,6 +1065,25 @@ maininit (int ac, string *av) #endif /* TeX */ } +#if defined(_MSC_VER) && _MSC_VER > 1600 +#include +void +myInvalidParameterHandler(const wchar_t* expression, + const wchar_t* function, + const wchar_t* file, + unsigned int line, + uintptr_t pReserved) +{ +/* After updating a compiler from Visual Studio 2010 to + Visual Studio 2015, XeTeX exits with the code 0xc0000417, + that means "invalid paremeter in CRT detected". + Probably it is safe to ignore the error. + So I use a handler which smiply return. +*/ + return; +} +#endif /* defined(_MSC_VER) ... */ + /* main: Set up for reading the command line, which will happen in `maininit' and `topenin', then call the main body, plus special Windows/Kanji initializations. */ @@ -1081,6 +1100,13 @@ main (int ac, string *av) _response (&ac, &av); #endif +#if defined(_MSC_VER) && _MSC_VER > 1600 + _invalid_parameter_handler oldHandler, newHandler; + newHandler = myInvalidParameterHandler; + oldHandler = _set_invalid_parameter_handler(newHandler); + _CrtSetReportMode(_CRT_ASSERT, 0); +#endif /* defined(_MSC_VER) ... */ + #ifdef WIN32 av[0] = kpse_program_basename (av[0]); _setmaxstdio(2048); -- cgit v1.2.3