[Commits] SDL: Fixed Windows gcc build

libsdl.org revision control commits-owner at libsdl.org
Mon Dec 11 11:43:54 PST 2017


details:   https://hg.libsdl.org/SDL/rev/74f570e0b634
changeset: 11761:74f570e0b634
user:      Sam Lantinga <slouken at libsdl.org>
date:      Mon Dec 11 11:47:52 2017 -0800
description:
Fixed Windows gcc build

diffstat:

 src/video/windows/SDL_windowsevents.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (21 lines):

diff -r e85aa67038df -r 74f570e0b634 src/video/windows/SDL_windowsevents.c
--- a/src/video/windows/SDL_windowsevents.c	Mon Dec 11 11:34:53 2017 -0800
+++ b/src/video/windows/SDL_windowsevents.c	Mon Dec 11 11:47:52 2017 -0800
@@ -1083,14 +1083,13 @@
 static SDL_bool
 IsWin10FCUorNewer(void)
 {
-    typedef LONG(WINAPI* RtlGetVersionPtr)(struct SDL_WIN_OSVERSIONINFOW*);
-    struct SDL_WIN_OSVERSIONINFOW info;
-    SDL_zero(info);
-
     HMODULE handle = GetModuleHandleW(L"ntdll.dll");
     if (handle) {
+        typedef LONG(WINAPI* RtlGetVersionPtr)(struct SDL_WIN_OSVERSIONINFOW*);
         RtlGetVersionPtr getVersionPtr = (RtlGetVersionPtr)GetProcAddress(handle, "RtlGetVersion");
         if (getVersionPtr != NULL) {
+            struct SDL_WIN_OSVERSIONINFOW info;
+            SDL_zero(info);
             info.dwOSVersionInfoSize = sizeof(info);
             if (getVersionPtr(&info) == 0) { /* STATUS_SUCCESS == 0 */
                 if (   (info.dwMajorVersion == 10 && info.dwMinorVersion == 0 && info.dwBuildNumber >= 16299)


More information about the commits mailing list