Always provide an implementation for all SDL3 symbols

This commit is contained in:
Anonymous Maarten 2023-09-27 06:11:09 +02:00 committed by Anonymous Maarten
parent 3a36433a3c
commit 25ce87979d
11 changed files with 404 additions and 4 deletions

View File

@ -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) \

View File

@ -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" />

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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" />

View File

@ -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>

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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