From 5a6955d059ce4bee9ca9e8c156b21ddcb89cf8f8 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Mon, 22 Feb 2021 17:00:10 +0300
Subject: [PATCH] MSVC: ExitProcess from _DllMainCRTStartup instead of
returning failure
avoids a second error dialog from the OS.
---
src/SDL12_compat.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 3267028..f452528 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -929,7 +929,9 @@ BOOL WINAPI _DllMainCRTStartup(HANDLE dllhandle, DWORD reason, LPVOID reserved)
case DLL_PROCESS_ATTACH: /* init once for each new process */
if (!LoadSDL20()) {
error_dialog(loaderror);
- return FALSE;
+ TerminateProcess(GetCurrentProcess(), 42);
+ ExitProcess(42);
+ return FALSE; /* NOT-REACHED */
}
break;