diff -rupN mingw-w64-v5.0.3.orig/mingw-w64-crt/include/msvcrt.h mingw-w64-v5.0.3/mingw-w64-crt/include/msvcrt.h --- mingw-w64-v5.0.3.orig/mingw-w64-crt/include/msvcrt.h 2017-10-27 03:04:58.000000000 -0700 +++ mingw-w64-v5.0.3/mingw-w64-crt/include/msvcrt.h 2020-11-29 23:10:13.115579589 -0800 @@ -6,5 +6,5 @@ static inline HANDLE __mingw_get_msvcrt_handle(void) { - return GetModuleHandleW(L"msvcrt.dll"); + return GetModuleHandleA("msvcrt.dll"); } diff -rupN mingw-w64-v5.0.3.orig/mingw-w64-crt/misc/wassert.c mingw-w64-v5.0.3/mingw-w64-crt/misc/wassert.c --- mingw-w64-v5.0.3.orig/mingw-w64-crt/misc/wassert.c 2017-10-27 03:04:58.000000000 -0700 +++ mingw-w64-v5.0.3/mingw-w64-crt/misc/wassert.c 2020-11-30 00:18:27.631570793 -0800 @@ -6,54 +6,34 @@ #include #include #include -#include #include extern int mingw_app_type; -void __cdecl _wassert (const wchar_t *, const wchar_t *,unsigned); void __cdecl _assert (const char *, const char *, unsigned); void __cdecl _assert (const char *_Message, const char *_File, unsigned _Line) { - wchar_t *m, *f; - int i; - m = (wchar_t *) malloc ((strlen (_Message) + 1) * sizeof (wchar_t)); - f = (wchar_t *) malloc ((strlen (_File) + 1) * sizeof (wchar_t)); - for (i = 0; _Message[i] != 0; i++) - m[i] = ((wchar_t) _Message[i]) & 0xff; - m[i] = 0; - for (i = 0; _File[i] != 0; i++) - f[i] = ((wchar_t) _File[i]) & 0xff; - f[i] = 0; - _wassert (m, f, _Line); - free (m); - free (f); -} - -void __cdecl -_wassert (const wchar_t *_Message, const wchar_t *_File, unsigned _Line) -{ - wchar_t *msgbuf = (wchar_t *) malloc (8192*sizeof(wchar_t)); - wchar_t fn[MAX_PATH + 1]; + char *msgbuf = (char *) malloc (8192); + char fn[MAX_PATH + 1]; DWORD nCode; if (!_File || _File[0] == 0) - _File = L""; + _File = ""; if (!_Message || _Message[0] == 0) - _Message = L"?"; - if (! GetModuleFileNameW (NULL, fn, MAX_PATH)) - wcscpy (fn, L""); - _snwprintf (msgbuf, 8191, L"Assertion failed!\n\nProgram: %ws\n" - "File: %ws, Line %u\n\nExpression: %ws", + _Message = "?"; + if (! GetModuleFileNameA (NULL, fn, MAX_PATH)) + strcpy (fn, ""); + _snprintf (msgbuf, 8191, "Assertion failed!\n\nProgram: %s\n" + "File: %s, Line %u\n\nExpression: %s", fn, _File,_Line, _Message); if (mingw_app_type == 0) { - fwprintf (stderr, L"%ws\n", msgbuf); + fprintf (stderr, "%s\n", msgbuf); abort (); } - nCode = MessageBoxW (NULL, msgbuf, L"MinGW Runtime Assertion", MB_ABORTRETRYIGNORE| + nCode = MessageBoxA (NULL, msgbuf, "MinGW Runtime Assertion", MB_ABORTRETRYIGNORE| MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL); if (nCode == IDABORT) {