removed WinRT support.

This commit is contained in:
Ozkan Sezer
2022-11-22 23:36:24 +03:00
parent bd5d26071a
commit dc2a3e06e9
86 changed files with 81 additions and 8098 deletions

View File

@@ -20,8 +20,6 @@
*/
#include "../../SDL_internal.h"
#ifndef __WINRT__
#include "SDL_hid.h"
@@ -85,6 +83,4 @@ WIN_UnloadHIDDLL(void)
}
}
#endif /* !__WINRT__ */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -25,8 +25,6 @@
#include "SDL_windows.h"
#ifndef __WINRT__
typedef LONG NTSTATUS;
typedef USHORT USAGE;
typedef struct _HIDP_PREPARSED_DATA *PHIDP_PREPARSED_DATA;
@@ -197,8 +195,6 @@ extern HidP_GetValueCaps_t SDL_HidP_GetValueCaps;
extern HidP_MaxDataListLength_t SDL_HidP_MaxDataListLength;
extern HidP_GetData_t SDL_HidP_GetData;
#endif /* !__WINRT__ */
#endif /* SDL_hid_h_ */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)
#if defined(__WIN32__) || defined(__GDK__)
#include "SDL_windows.h"
#include "SDL_error.h"
@@ -89,14 +89,7 @@ WIN_CoInitialize(void)
If you need multi-threaded mode, call CoInitializeEx() before SDL_Init()
*/
#ifdef __WINRT__
/* DLudwig: On WinRT, it is assumed that COM was initialized in main().
CoInitializeEx is available (not CoInitialize though), however
on WinRT, main() is typically declared with the [MTAThread]
attribute, which, AFAIK, should initialize COM.
*/
return S_OK;
#elif defined(__XBOXONE__) || defined(__XBOXSERIES__)
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
/* On Xbox, there's no need to call CoInitializeEx (and it's not implemented) */
return S_OK;
#else
@@ -118,12 +111,9 @@ WIN_CoInitialize(void)
void
WIN_CoUninitialize(void)
{
#ifndef __WINRT__
CoUninitialize();
#endif
}
#ifndef __WINRT__
void *
WIN_LoadComBaseFunction(const char *name)
{
@@ -140,14 +130,10 @@ WIN_LoadComBaseFunction(const char *name)
return NULL;
}
}
#endif
HRESULT
WIN_RoInitialize(void)
{
#ifdef __WINRT__
return S_OK;
#else
typedef HRESULT (WINAPI *RoInitialize_t)(RO_INIT_TYPE initType);
RoInitialize_t RoInitializeFunc = (RoInitialize_t)WIN_LoadComBaseFunction("RoInitialize");
if (RoInitializeFunc) {
@@ -167,22 +153,19 @@ WIN_RoInitialize(void)
} else {
return E_NOINTERFACE;
}
#endif
}
void
WIN_RoUninitialize(void)
{
#ifndef __WINRT__
typedef void (WINAPI *RoUninitialize_t)(void);
RoUninitialize_t RoUninitializeFunc = (RoUninitialize_t)WIN_LoadComBaseFunction("RoUninitialize");
if (RoUninitializeFunc) {
RoUninitializeFunc();
}
#endif
}
#if !defined(__WINRT__) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
static BOOL
IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)
{
@@ -206,7 +189,7 @@ IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServiceP
BOOL WIN_IsWindowsVistaOrGreater(void)
{
#if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
return TRUE;
#else
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0);
@@ -215,7 +198,7 @@ BOOL WIN_IsWindowsVistaOrGreater(void)
BOOL WIN_IsWindows7OrGreater(void)
{
#if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
return TRUE;
#else
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0);
@@ -224,7 +207,7 @@ BOOL WIN_IsWindows7OrGreater(void)
BOOL WIN_IsWindows8OrGreater(void)
{
#if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
return TRUE;
#else
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0);
@@ -255,8 +238,8 @@ WASAPI doesn't need this. This is just for DirectSound/WinMM.
char *
WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
{
#if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
return WIN_StringToUTF8(name); /* No registry access on WinRT/UWP and Xbox, go with what we've got. */
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
return WIN_StringToUTF8(name); /* No registry access on Xbox, go with what we've got. */
#else
static const GUID nullguid = { 0 };
const unsigned char *ptr;
@@ -308,7 +291,7 @@ WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
retval = WIN_StringToUTF8(strw);
SDL_free(strw);
return retval ? retval : WIN_StringToUTF8(name);
#endif /* if __WINRT__ / else */
#endif /**/
}
BOOL
@@ -341,6 +324,6 @@ WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect)
winrect->bottom = sdlrect->y + sdlrect->h - 1;
}
#endif /* defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__) */
#endif /* defined(__WIN32__) || defined(__GDK__) */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -120,10 +120,8 @@ extern int WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr);
/* Sets an error message based on GetLastError(). Always return -1. */
extern int WIN_SetError(const char *prefix);
#if !defined(__WINRT__)
/* Load a function from combase.dll */
void *WIN_LoadComBaseFunction(const char *name);
#endif
/* Wrap up the oddities of CoInitialize() into a common function. */
extern HRESULT WIN_CoInitialize(void);

View File

@@ -37,7 +37,7 @@ static HANDLE s_pXInputDLL = 0;
static int s_XInputDLLRefCount = 0;
#if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
int
WIN_LoadXInputDLL(void)
@@ -70,7 +70,7 @@ WIN_UnloadXInputDLL(void)
{
}
#else /* !(defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)) */
#else /* !(defined(__XBOXONE__) || defined(__XBOXSERIES__)) */
int
WIN_LoadXInputDLL(void)
@@ -138,7 +138,7 @@ WIN_UnloadXInputDLL(void)
}
}
#endif /* __WINRT__ */
#endif /**/
/* Ends C function definitions when using C++ */
#ifdef __cplusplus