From 141f441633e7ea860e5fa3cc2573b88e393269d6 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Sun, 24 Jan 2021 03:55:04 -0800 Subject: [PATCH] fix build failure due to -Werror=declaration-after-statement (bug #5500) --- src/video/windows/SDL_windowsevents.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index acb52c3ce..ef6403189 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -431,12 +431,13 @@ static SDL_MOUSE_EVENT_SOURCE GetMouseMessageSource() LRESULT CALLBACK WIN_KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam) { + KBDLLHOOKSTRUCT* hookData = (KBDLLHOOKSTRUCT*)lParam; + SDL_Scancode scanCode; + if (nCode < 0 || nCode != HC_ACTION) { return CallNextHookEx(NULL, nCode, wParam, lParam); } - KBDLLHOOKSTRUCT* hookData = (KBDLLHOOKSTRUCT*)lParam; - SDL_Scancode scanCode; switch (hookData->vkCode) { case VK_LWIN: scanCode = SDL_SCANCODE_LGUI;