Commit 141f441633e7ea860e5fa3cc2573b88e393269d6

Brandon DeRosier 2021-01-24T03:55:04

fix build failure due to -Werror=declaration-after-statement (bug #5500)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index acb52c3..ef64031 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;