From fb4ec071198b4dea3d5396a1d855d280dd3b2e83 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 6 Jan 2025 11:18:45 -0800
Subject: [PATCH] Fixed warning C4701: potentially uninitialized local variable
'previous_context' used
---
src/video/windows/SDL_windowsmessagebox.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/video/windows/SDL_windowsmessagebox.c b/src/video/windows/SDL_windowsmessagebox.c
index 0162d162089c4..c174e3d6edf55 100644
--- a/src/video/windows/SDL_windowsmessagebox.c
+++ b/src/video/windows/SDL_windowsmessagebox.c
@@ -960,7 +960,7 @@ bool WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonID)
HMODULE hUser32 = GetModuleHandle(TEXT("user32.dll"));
typedef DPI_AWARENESS_CONTEXT (WINAPI * SetThreadDpiAwarenessContext_t)(DPI_AWARENESS_CONTEXT);
SetThreadDpiAwarenessContext_t SetThreadDpiAwarenessContextFunc = (SetThreadDpiAwarenessContext_t)GetProcAddress(hUser32, "SetThreadDpiAwarenessContext");
- DPI_AWARENESS_CONTEXT previous_context;
+ DPI_AWARENESS_CONTEXT previous_context = DPI_AWARENESS_CONTEXT_UNAWARE;
if (SetThreadDpiAwarenessContextFunc) {
previous_context = SetThreadDpiAwarenessContextFunc(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
}