[Commits] SDL: windows: Remove references to GetVersionExA (thanks, Andrew...

libsdl.org revision control commits-owner at libsdl.org
Mon Jan 1 16:18:07 PST 2018


details:   https://hg.libsdl.org/SDL/rev/454f6dc9cb85
changeset: 11803:454f6dc9cb85
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Mon Jan 01 19:16:51 2018 -0500
description:
windows: Remove references to GetVersionExA (thanks, Andrew Pilley!).

"GetVersionExA is deprecated in windows 8.1 and above's SDK, causing a warning
when building against the win10 SDK. Attached patch cleans up the usage for a
warning-free build.

GetVersionExA was being used to test to see if SDL was running on win9x or
winnt. A quick chat with Ryan on twitter suggested that SDL doesn't
officially support win9x anymore, so the call to this can be outright removed.

As an aside, replacing the call to GetVersionExA with VerifyVersionInfoA (the
recommended path) would have been pointless, as VerifyVersionInfoA only
supports VER_PLATFORM_WIN32_NT and doesn't officially support any other value
for dwPlatformId currently. (And it's probable that win9x SDKs didn't have
VerifyVersionInfo* in them anyway.)"

Fixes Bugzilla #4019.

diffstat:

 src/video/windows/SDL_windowskeyboard.c |  9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diffs (31 lines):

diff -r 3f5fad386f11 -r 454f6dc9cb85 src/video/windows/SDL_windowskeyboard.c
--- a/src/video/windows/SDL_windowskeyboard.c	Mon Jan 01 19:40:29 2018 -0400
+++ b/src/video/windows/SDL_windowskeyboard.c	Mon Jan 01 19:16:51 2018 -0500
@@ -446,16 +446,12 @@
     INT err = 0;
     BOOL vertical = FALSE;
     UINT maxuilen = 0;
-    static OSVERSIONINFOA osversion;
 
     if (videodata->ime_uiless)
         return;
 
     videodata->ime_readingstring[0] = 0;
-    if (!osversion.dwOSVersionInfoSize) {
-        osversion.dwOSVersionInfoSize = sizeof(osversion);
-        GetVersionExA(&osversion);
-    }
+    
     id = IME_GetId(videodata, 0);
     if (!id)
         return;
@@ -516,9 +512,6 @@
             }
             break;
         case IMEID_CHS_VER42:
-            if (osversion.dwPlatformId != VER_PLATFORM_WIN32_NT)
-                break;
-
             p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 1*4 + 1*4 + 6*4);
             if (!p)
                 break;


More information about the commits mailing list