[Commits] SDL: windows: added WIN_IsWindows7OrGreater().

libsdl.org revision control commits-owner at libsdl.org
Wed Feb 21 19:04:59 PST 2018


details:   https://hg.libsdl.org/SDL/rev/ba555daded29
changeset: 11888:ba555daded29
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Wed Feb 21 21:36:10 2018 -0500
description:
windows: added WIN_IsWindows7OrGreater().

diffstat:

 src/core/windows/SDL_windows.c |  9 +++++++++
 src/core/windows/SDL_windows.h |  3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)

diffs (32 lines):

diff -r 1a033404c88b -r ba555daded29 src/core/windows/SDL_windows.c
--- a/src/core/windows/SDL_windows.c	Wed Feb 21 12:42:30 2018 -0500
+++ b/src/core/windows/SDL_windows.c	Wed Feb 21 21:36:10 2018 -0500
@@ -124,6 +124,15 @@
 #endif
 }
 
+BOOL WIN_IsWindows7OrGreater(void)
+{
+#ifdef __WINRT__
+    return TRUE;
+#else
+    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0);
+#endif
+}
+
 /*
 WAVExxxCAPS gives you 31 bytes for the device name, and just truncates if it's
 longer. However, since WinXP, you can use the WAVExxxCAPS2 structure, which
diff -r 1a033404c88b -r ba555daded29 src/core/windows/SDL_windows.h
--- a/src/core/windows/SDL_windows.h	Wed Feb 21 12:42:30 2018 -0500
+++ b/src/core/windows/SDL_windows.h	Wed Feb 21 21:36:10 2018 -0500
@@ -60,6 +60,9 @@
 /* Returns SDL_TRUE if we're running on Windows Vista and newer */
 extern BOOL WIN_IsWindowsVistaOrGreater(void);
 
+/* Returns SDL_TRUE if we're running on Windows 7 and newer */
+extern BOOL WIN_IsWindows7OrGreater(void);
+
 /* You need to SDL_free() the result of this call. */
 extern char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid);
 


More information about the commits mailing list