Mac and Linux SDL2 binary snapshots
Edward Rudd
2018-08-19 561f0d614098a95527367cc3f911e476f35643d6
source/src/core/windows/SDL_windows.c
@@ -1,6 +1,6 @@
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
@@ -33,7 +33,7 @@
#endif
/* Sets an error message based on GetLastError() */
/* Sets an error message based on an HRESULT */
int
WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr)
{
@@ -115,12 +115,21 @@
}
#endif
BOOL WIN_IsWindowsVistaOrGreater()
BOOL WIN_IsWindowsVistaOrGreater(void)
{
#ifdef __WINRT__
    return TRUE;
#else
    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0);
#endif
}
BOOL WIN_IsWindows7OrGreater(void)
{
#ifdef __WINRT__
    return TRUE;
#else
    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0);
#endif
}
@@ -142,6 +151,8 @@
(Also, DirectSound shouldn't be limited to 32 chars, but its device enum
has the same problem.)
WASAPI doesn't need this. This is just for DirectSound/WinMM.
*/
char *
WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
@@ -158,7 +169,7 @@
    DWORD len = 0;
    char *retval = NULL;
    if (SDL_memcmp(guid, &nullguid, sizeof (*guid)) == 0) {
    if (WIN_IsEqualGUID(guid, &nullguid)) {
        return WIN_StringToUTF8(name);  /* No GUID, go with what we've got. */
    }
@@ -202,6 +213,18 @@
#endif /* if __WINRT__ / else */
}
BOOL
WIN_IsEqualGUID(const GUID * a, const GUID * b)
{
    return (SDL_memcmp(a, b, sizeof (*a)) == 0);
}
BOOL
WIN_IsEqualIID(REFIID a, REFIID b)
{
    return (SDL_memcmp(a, b, sizeof (*a)) == 0);
}
#endif /* __WIN32__ || __WINRT__ */
/* vi: set ts=4 sw=4 expandtab: */