Skip to content

Commit

Permalink
windows: added WIN_IsWindows7OrGreater().
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 22, 2018
1 parent 6e3d0a1 commit ed64d54
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/windows/SDL_windows.c
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/core/windows/SDL_windows.h
Expand Up @@ -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);

Expand Down

0 comments on commit ed64d54

Please sign in to comment.