From 25ce87979dc571e4e85090fcb747639a0db85173 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Wed, 27 Sep 2023 06:11:09 +0200
Subject: [PATCH] Always provide an implementation for all SDL3 symbols
---
Android.mk | 1 +
VisualC-GDK/SDL/SDL.vcxproj | 4 +
VisualC-GDK/SDL/SDL.vcxproj.filters | 13 ++
VisualC-WinRT/SDL-UWP.vcxproj | 4 +
VisualC-WinRT/SDL-UWP.vcxproj.filters | 12 ++
VisualC/SDL/SDL.vcxproj | 4 +
VisualC/SDL/SDL.vcxproj.filters | 14 +-
src/core/SDL_core_unsupported.c | 218 +++++++++++++++++++++++
src/render/SDL_render_unsupported.c | 49 +++++
src/render/direct3d12/SDL_render_d3d12.c | 6 +-
src/video/SDL_video_unsupported.c | 83 +++++++++
11 files changed, 404 insertions(+), 4 deletions(-)
create mode 100644 src/core/SDL_core_unsupported.c
create mode 100644 src/render/SDL_render_unsupported.c
create mode 100644 src/video/SDL_video_unsupported.c
diff --git a/Android.mk b/Android.mk
index 4c26d3c9886a..3779eb53416b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -24,6 +24,7 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/audio/openslES/*.c) \
$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
+ $(wildcard $(LOCAL_PATH)/src/core/*.c) \
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj
index 7df28485fcaa..bb003d0f0831 100644
--- a/VisualC-GDK/SDL/SDL.vcxproj
+++ b/VisualC-GDK/SDL/SDL.vcxproj
@@ -557,6 +557,8 @@
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.c" />
+ <ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
+ <ClCompile Include="..\..\src\core\SDL_runapp.c" />
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
@@ -699,6 +701,7 @@
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
<ClCompile Include="..\..\src\render\SDL_render.c" />
+ <ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
@@ -767,6 +770,7 @@
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
<ClCompile Include="..\..\src\video\SDL_surface.c" />
<ClCompile Include="..\..\src\video\SDL_video.c" />
+ <ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters
index 19b7eb904b86..bbdc75985c4d 100644
--- a/VisualC-GDK/SDL/SDL.vcxproj.filters
+++ b/VisualC-GDK/SDL/SDL.vcxproj.filters
@@ -885,6 +885,13 @@
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c">
<Filter>atomic</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\SDL_core_unsupported.c">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\core\SDL_runapp.c">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Inclu
<ClCompile Include="..\..\src\core\windows\SDL_hid.c">
<Filter>core\windows</Filter>
</ClCompile>
@@ -1182,6 +1189,9 @@
<ClCompile Include="..\..\src\video\SDL_video.c">
<Filter>video</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\video\SDL_video_unsupported.c">
+ <Filter>video</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\video\SDL_yuv.c">
<Filter>video</Filter>
</ClCompile>
@@ -1308,6 +1318,9 @@
<ClCompile Include="..\..\src\render\SDL_render.c">
<Filter>render</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\render\SDL_render_unsupported.c">
+ <Filter>render</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c">
<Filter>render</Filter>
</ClCompile>
diff --git a/VisualC-WinRT/SDL-UWP.vcxproj b/VisualC-WinRT/SDL-UWP.vcxproj
index c911765b9941..372a28339683 100644
--- a/VisualC-WinRT/SDL-UWP.vcxproj
+++ b/VisualC-WinRT/SDL-UWP.vcxproj
@@ -250,6 +250,8 @@
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</CompileAsWinRT>
</ClCompile>
+ <ClCompile Include="..\src\core\SDL_core_unsupported.c" />
+ <ClCompile Include="..\src\core\SDL_runapp.c" />
<ClCompile Include="..\src\core\windows\SDL_windows.c" />
<ClCompile Include="..\src\core\windows\SDL_xinput.c" />
<ClCompile Include="..\src\core\winrt\SDL_winrtapp_common.cpp">
@@ -383,6 +385,7 @@
<ClCompile Include="..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\src\render\SDL_d3dmath.c" />
<ClCompile Include="..\src\render\SDL_render.c" />
+ <ClCompile Include="..\src\render\SDL_render_unsupported.c" />
<ClCompile Include="..\src\render\SDL_yuv_sw.c" />
<ClCompile Include="..\src\render\software\SDL_blendfillrect.c" />
<ClCompile Include="..\src\render\software\SDL_blendline.c" />
@@ -512,6 +515,7 @@
<ClCompile Include="..\src\video\SDL_stretch.c" />
<ClCompile Include="..\src\video\SDL_surface.c" />
<ClCompile Include="..\src\video\SDL_video.c" />
+ <ClCompile Include="..\src\video\SDL_video_unsupported.c" />
<ClCompile Include="..\src\video\SDL_yuv.c" />
<ClCompile Include="..\src\video\winrt\SDL_winrtevents.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
diff --git a/VisualC-WinRT/SDL-UWP.vcxproj.filters b/VisualC-WinRT/SDL-UWP.vcxproj.filters
index 7b90f411fbee..92e6f4a8d4e7 100644
--- a/VisualC-WinRT/SDL-UWP.vcxproj.filters
+++ b/VisualC-WinRT/SDL-UWP.vcxproj.filters
@@ -498,6 +498,12 @@
<ClCompile Include="..\src\audio\wasapi\SDL_wasapi_winrt.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\src\core\SDL_core_unsupported.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\src\core\SDL_runapp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
<ClCompile Include="..\src\core\windows\SDL_windows.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -606,6 +612,9 @@
<ClCompile Include="..\src\render\SDL_render.c">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\src\render\SDL_render_unsupported.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
<ClCompile Include="..\src\render\SDL_yuv_sw.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -786,6 +795,9 @@
<ClCompile Include="..\src\video\SDL_video.c">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\src\video\SDL_video_unsupported.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtevents.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj
index f4d4dc002cb0..5a63ba770e37 100644
--- a/VisualC/SDL/SDL.vcxproj
+++ b/VisualC/SDL/SDL.vcxproj
@@ -484,6 +484,8 @@
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.c" />
+ <ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
+ <ClCompile Include="..\..\src\core\SDL_runapp.c" />
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
@@ -578,6 +580,7 @@
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
<ClCompile Include="..\..\src\render\SDL_render.c" />
+ <ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
@@ -642,6 +645,7 @@
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
<ClCompile Include="..\..\src\video\SDL_surface.c" />
<ClCompile Include="..\..\src\video\SDL_video.c" />
+ <ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters
index f72de3a0a0cf..b2e57b4fabf5 100644
--- a/VisualC/SDL/SDL.vcxproj.filters
+++ b/VisualC/SDL/SDL.vcxproj.filters
@@ -419,7 +419,7 @@
</ClInclude>
<ClInclude Include="..\..\src\audio\SDL_audioresample.h">
<Filter>audio</Filter>
- </ClInclude>
+ </ClInclude>
<ClInclude Include="..\..\src\core\windows\SDL_hid.h">
<Filter>core\windows</Filter>
</ClInclude>
@@ -864,6 +864,12 @@
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c">
<Filter>atomic</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\SDL_core_unsupported.c">
+ <Filter>core</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\core\SDL_runapp.c">
+ <Filter>core</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\core\windows\SDL_hid.c">
<Filter>core\windows</Filter>
</ClCompile>
@@ -1161,6 +1167,9 @@
<ClCompile Include="..\..\src\video\SDL_video.c">
<Filter>video</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\video\SDL_video_unsupported.c">
+ <Filter>video</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\video\SDL_yuv.c">
<Filter>video</Filter>
</ClCompile>
@@ -1290,6 +1299,9 @@
<ClCompile Include="..\..\src\render\SDL_render.c">
<Filter>render</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\render\SDL_render_unsupported.c">
+ <Filter>render</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c">
<Filter>render</Filter>
</ClCompile>
diff --git a/src/core/SDL_core_unsupported.c b/src/core/SDL_core_unsupported.c
new file mode 100644
index 000000000000..5e1f82834944
--- /dev/null
+++ b/src/core/SDL_core_unsupported.c
@@ -0,0 +1,218 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2023 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
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+#include "SDL_internal.h"
+
+#ifndef __LINUX__
+
+DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
+int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority)
+{
+ (void)threadID;
+ (void)priority;
+ return SDL_Unsupported();
+}
+
+DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
+int SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
+{
+ (void)threadID;
+ (void)sdlPriority;
+ (void)schedPolicy;
+ return SDL_Unsupported();
+}
+
+#endif
+
+#ifndef __GDK__
+
+DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
+void SDL_GDKSuspendComplete(void)
+{
+ SDL_Unsupported();
+}
+
+DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(void *outUserHandle); /* XUserHandle *outUserHandle */
+int SDL_GDKGetDefaultUser(void *outUserHandle)
+{
+ return SDL_Unsupported();
+}
+
+#endif
+
+#if !(defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__))
+
+DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
+int SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
+{
+ (void)name;
+ (void)style;
+ (void)hInst;
+ return SDL_Unsupported();
+}
+
+DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(void *callback, void *userdata); /* SDL_WindowsMessageHook callback */
+void SDL_SetWindowsMessageHook(void *callback, void *userdata)
+{
+ (void)callback;
+ (void)userdata;
+ SDL_Unsupported();
+}
+
+DECLSPEC void SDLCALL SDL_UnregisterApp(void);
+void SDL_UnregisterApp(void)
+{
+ SDL_Unsupported();
+}
+
+#endif
+
+#ifndef __WINRT__
+
+/* Returns SDL_WinRT_DeviceFamily enum */
+DECLSPEC int SDLCALL SDL_WinRTGetDeviceFamily(void);
+int SDL_WinRTGetDeviceFamily()
+{
+ SDL_Unsupported();
+ return 0; /* SDL_WINRT_DEVICEFAMILY_UNKNOWN */
+}
+
+DECLSPEC const wchar_t *SDLCALL SDL_WinRTGetFSPathUNICODE(int pathType); /* SDL_WinRT_Path pathType */
+const wchar_t *SDL_WinRTGetFSPathUNICODE(int pathType)
+{
+ (void)pathType;
+ SDL_Unsupported();
+ return NULL;
+}
+
+DECLSPEC const char *SDLCALL SDL_WinRTGetFSPathUTF8(int pathType); /* SDL_WinRT_Path pathType */
+const char *SDL_WinRTGetFSPathUTF8(int pathType)
+{
+ (void)pathType;
+ SDL_Unsupported();
+ return NULL;
+}
+#endif
+
+#ifndef __ANDROID__
+
+DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
+void SDL_AndroidBackButton()
+{
+ SDL_Unsupported();
+}
+
+DECLSPEC void *SDLCALL SDL_AndroidGetActivity(void);
+void *SDL_AndroidGetActivity()
+{
+ SDL_Unsupported();
+ return NULL;
+}
+
+DECLSPEC const char *SDLCALL SDL_AndroidGetExternalStoragePath(void);
+const char* SDL_AndroidGetExternalStoragePath()
+{
+ SDL_Unsupported();
+ return NULL;
+}
+
+DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state);
+int SDL_AndroidGetExternalStorageState(Uint32 *state)
+{
+ (void)state;
+ return SDL_Unsupported();
+}
+DECLSPEC const char *SDLCALL SDL_AndroidGetInternalStoragePath(void);
+const char *SDL_AndroidGetInternalStoragePath()
+{
+ SDL_Unsupported();
+ return NULL;
+}
+
+DECLSPEC void *SDLCALL SDL_AndroidGetJNIEnv(void);
+void *SDL_AndroidGetJNIEnv()
+{
+ SDL_Unsupported();
+ return NULL;
+}
+
+DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
+SDL_bool SDL_AndroidRequestPermission(const char *permission)
+{
+ (void)permission;
+ SDL_Unsupported();
+ return SDL_FALSE;
+}
+
+DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
+int SDL_AndroidSendMessage(Uint32 command, int param)
+{
+ (void)command;
+ (void)param;
+ return SDL_Unsupported();
+}
+
+DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
+int SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset)
+{
+ (void)message;
+ (void)duration;
+ (void)gravity;
+ (void)xoffset;
+ (void)yoffset;
+ return SDL_Unsupported();
+}
+
+DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
+int SDL_GetAndroidSDKVersion()
+{
+ return SDL_Unsupported();
+}
+
+DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
+SDL_bool SDL_IsAndroidTV()
+{
+ SDL_Unsupported();
+ return SDL_FALSE;
+}
+
+DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
+SDL_bool SDL_IsChromebook()
+{
+ SDL_Unsupported();
+ return SDL_FALSE;
+}
+
+DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
+SDL_bool SDL_IsDeXMode(void)
+{
+ SDL_Unsupported();
+ return SDL_FALSE;
+}
+
+DECLSPEC Sint32 SDLCALL JNI_OnLoad(void *vm, void *reserved);
+Sint32 JNI_OnLoad(void *vm, void *reserved)
+{
+ (void)vm;
+ (void)reserved;
+ SDL_Unsupported();
+ return -1; /* JNI_ERR */
+}
+#endif
diff --git a/src/render/SDL_render_unsupported.c b/src/render/SDL_render_unsupported.c
new file mode 100644
index 000000000000..4d223895f941
--- /dev/null
+++ b/src/render/SDL_render_unsupported.c
@@ -0,0 +1,49 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2023 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
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+#include "SDL_internal.h"
+
+#if !(defined(__WIN32__) || defined(__WINGDK__))
+
+DECLSPEC void *SDLCALL SDL_GetRenderD3D9Device(SDL_Renderer *renderer); /* returns IDirect3DDevice9 * */
+void *SDL_GetRenderD3D9Device(SDL_Renderer *renderer)
+{
+ (void)renderer;
+ SDL_Unsupported();
+ return NULL;
+}
+
+DECLSPEC void *SDLCALL SDL_GetRenderD3D11Device(SDL_Renderer *renderer); /* returns ID3D11Device * */
+void *SDL_GetRenderD3D11Device(SDL_Renderer *renderer)
+{
+ (void)renderer;
+ SDL_Unsupported();
+ return NULL;
+}
+
+DECLSPEC void *SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer *renderer); /* return ID3D12Device * */
+void *SDL_RenderGetD3D12Device(SDL_Renderer *renderer)
+{
+ (void)renderer;
+ SDL_Unsupported();
+ return NULL;
+}
+
+#endif
diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c
index fb18838dce0e..0a5ddca37770 100644
--- a/src/render/direct3d12/SDL_render_d3d12.c
+++ b/src/render/direct3d12/SDL_render_d3d12.c
@@ -3051,9 +3051,9 @@ SDL_RenderDriver D3D12_RenderDriver = {
#ifdef __cplusplus
extern "C"
#endif
- /* This function needs to always exist on Windows, for the Dynamic API. */
- ID3D12Device *
- SDL_RenderGetD3D12Device(SDL_Renderer *renderer)
+/* This function needs to always exist on Windows, for the Dynamic API. */
+ID3D12Device *
+SDL_RenderGetD3D12Device(SDL_Renderer *renderer)
{
ID3D12Device *device = NULL;
diff --git a/src/video/SDL_video_unsupported.c b/src/video/SDL_video_unsupported.c
new file mode 100644
index 000000000000..66be30101873
--- /dev/null
+++ b/src/video/SDL_video_unsupported.c
@@ -0,0 +1,83 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2023 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
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+#include "SDL_internal.h"
+
+#ifndef SDL_VIDEO_DRIVER_WINDOWS
+
+DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
+SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex)
+{
+ (void)displayID;
+ (void)adapterIndex;
+ (void)outputIndex;
+ SDL_Unsupported();
+ return SDL_FALSE;
+}
+
+DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID);
+int SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID)
+{
+ (void)displayID;
+ return SDL_Unsupported();
+}
+
+#endif
+
+#ifndef SDL_GDK_TEXTINPUT
+
+DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(void *outTaskQueue);
+int SDL_GDKGetTaskQueue(void *outTaskQueue)
+{
+ (void)outTaskQueue;
+ return SDL_Unsupported();
+}
+
+#endif
+
+#ifndef SDL_VIDEO_DRIVER_UIKIT
+
+DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
+void SDL_OnApplicationDidChangeStatusBarOrientation(void)
+{
+ SDL_Unsupported();
+}
+
+#endif
+
+#ifndef SDL_VIDEO_DRIVER_UIKIT
+
+DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window *window, int interval, void (*callback)(void *), void *callbackParam);
+int SDL_iPhoneSetAnimationCallback(SDL_Window *window, int interval, void (*callback)(void *), void *callbackParam)
+{
+ (void)window;
+ (void)interval;
+ (void)callback;
+ (void)callbackParam;
+ return SDL_Unsupported();
+}
+
+DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
+void SDL_iPhoneSetEventPump(SDL_bool enabled)
+{
+ (void)enabled;
+ SDL_Unsupported();
+}
+#endif