From ed64d54dfd9a69a6b16eb603663041b520c48e48 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 21 Feb 2018 21:36:10 -0500 Subject: [PATCH] windows: added WIN_IsWindows7OrGreater(). --- src/core/windows/SDL_windows.c | 9 +++++++++ src/core/windows/SDL_windows.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/core/windows/SDL_windows.c b/src/core/windows/SDL_windows.c index d5fb5dd802ae0..66240435ff3b7 100644 --- a/src/core/windows/SDL_windows.c +++ b/src/core/windows/SDL_windows.c @@ -124,6 +124,15 @@ BOOL WIN_IsWindowsVistaOrGreater(void) #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 --git a/src/core/windows/SDL_windows.h b/src/core/windows/SDL_windows.h index d1e1a0029366c..4a3336ad8ed30 100644 --- a/src/core/windows/SDL_windows.h +++ b/src/core/windows/SDL_windows.h @@ -60,6 +60,9 @@ extern void WIN_CoUninitialize(void); /* 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);