windows: added WIN_IsWindows7OrGreater().
authorRyan C. Gordon <icculus@icculus.org>
Wed, 21 Feb 2018 21:36:10 -0500
changeset 11888ba555daded29
parent 11887 1a033404c88b
child 11889 150d030bfd48
windows: added WIN_IsWindows7OrGreater().
src/core/windows/SDL_windows.c
src/core/windows/SDL_windows.h
     1.1 --- a/src/core/windows/SDL_windows.c	Wed Feb 21 12:42:30 2018 -0500
     1.2 +++ b/src/core/windows/SDL_windows.c	Wed Feb 21 21:36:10 2018 -0500
     1.3 @@ -124,6 +124,15 @@
     1.4  #endif
     1.5  }
     1.6  
     1.7 +BOOL WIN_IsWindows7OrGreater(void)
     1.8 +{
     1.9 +#ifdef __WINRT__
    1.10 +    return TRUE;
    1.11 +#else
    1.12 +    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0);
    1.13 +#endif
    1.14 +}
    1.15 +
    1.16  /*
    1.17  WAVExxxCAPS gives you 31 bytes for the device name, and just truncates if it's
    1.18  longer. However, since WinXP, you can use the WAVExxxCAPS2 structure, which
     2.1 --- a/src/core/windows/SDL_windows.h	Wed Feb 21 12:42:30 2018 -0500
     2.2 +++ b/src/core/windows/SDL_windows.h	Wed Feb 21 21:36:10 2018 -0500
     2.3 @@ -60,6 +60,9 @@
     2.4  /* Returns SDL_TRUE if we're running on Windows Vista and newer */
     2.5  extern BOOL WIN_IsWindowsVistaOrGreater(void);
     2.6  
     2.7 +/* Returns SDL_TRUE if we're running on Windows 7 and newer */
     2.8 +extern BOOL WIN_IsWindows7OrGreater(void);
     2.9 +
    2.10  /* You need to SDL_free() the result of this call. */
    2.11  extern char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid);
    2.12