Renamed DECLSPEC to SDL_DECLSPEC

This commit is contained in:
Sam Lantinga
2024-05-17 16:52:36 -07:00
parent 2cf32b0e0a
commit 6f2621438a
67 changed files with 1090 additions and 1099 deletions

View File

@@ -66,12 +66,12 @@
#if SDL_DYNAMIC_API
#include "dynapi/SDL_dynapi_overrides.h"
/* force DECLSPEC off...it's all internal symbols now.
/* force SDL_DECLSPEC off...it's all internal symbols now.
These will have actual #defines during SDL_dynapi.c only */
#ifdef DECLSPEC
#undef DECLSPEC
#ifdef SDL_DECLSPEC
#undef SDL_DECLSPEC
#endif
#define DECLSPEC
#define SDL_DECLSPEC
#endif
#ifdef SDL_PLATFORM_APPLE
@@ -279,10 +279,10 @@
extern "C" {
#endif
extern DECLSPEC Uint32 SDLCALL SDL_GetNextObjectID(void);
extern DECLSPEC int SDLCALL SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS);
extern DECLSPEC int SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS);
extern DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS);
extern Uint32 SDLCALL SDL_GetNextObjectID(void);
extern int SDLCALL SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS);
extern int SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS);
extern SDL_bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@@ -22,7 +22,8 @@
#ifndef SDL_VIDEO_DRIVER_X11
DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata)
SDL_DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata);
void SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata)
{
}
@@ -30,7 +31,7 @@ DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, void *userd
#ifndef SDL_PLATFORM_LINUX
DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
SDL_DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority)
{
(void)threadID;
@@ -38,7 +39,7 @@ int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority)
return SDL_Unsupported();
}
DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
SDL_DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
int SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
{
(void)threadID;
@@ -51,13 +52,13 @@ int SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int sc
#ifndef SDL_PLATFORM_GDK
DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
void SDL_GDKSuspendComplete(void)
{
SDL_Unsupported();
}
DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(void *outUserHandle); /* XUserHandle *outUserHandle */
SDL_DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(void *outUserHandle); /* XUserHandle *outUserHandle */
int SDL_GDKGetDefaultUser(void *outUserHandle)
{
return SDL_Unsupported();
@@ -67,7 +68,7 @@ int SDL_GDKGetDefaultUser(void *outUserHandle)
#if !(defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK))
DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
SDL_DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
int SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
{
(void)name;
@@ -76,7 +77,7 @@ int SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
return SDL_Unsupported();
}
DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(void *callback, void *userdata); /* SDL_WindowsMessageHook callback */
SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(void *callback, void *userdata); /* SDL_WindowsMessageHook callback */
void SDL_SetWindowsMessageHook(void *callback, void *userdata)
{
(void)callback;
@@ -84,7 +85,7 @@ void SDL_SetWindowsMessageHook(void *callback, void *userdata)
SDL_Unsupported();
}
DECLSPEC void SDLCALL SDL_UnregisterApp(void);
SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void);
void SDL_UnregisterApp(void)
{
SDL_Unsupported();
@@ -95,14 +96,14 @@ void SDL_UnregisterApp(void)
#ifndef SDL_PLATFORM_WINRT
/* Returns SDL_WinRT_DeviceFamily enum */
DECLSPEC int SDLCALL SDL_WinRTGetDeviceFamily(void);
SDL_DECLSPEC int SDLCALL SDL_WinRTGetDeviceFamily(void);
int SDL_WinRTGetDeviceFamily()
{
SDL_Unsupported();
return 0; /* SDL_WINRT_DEVICEFAMILY_UNKNOWN */
}
DECLSPEC const char *SDLCALL SDL_WinRTGetFSPath(int pathType); /* SDL_WinRT_Path pathType */
SDL_DECLSPEC const char *SDLCALL SDL_WinRTGetFSPath(int pathType); /* SDL_WinRT_Path pathType */
const char *SDL_WinRTGetFSPath(int pathType)
{
(void)pathType;
@@ -113,40 +114,40 @@ const char *SDL_WinRTGetFSPath(int pathType)
#ifndef SDL_PLATFORM_ANDROID
DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
SDL_DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
void SDL_AndroidBackButton()
{
SDL_Unsupported();
}
DECLSPEC void *SDLCALL SDL_AndroidGetActivity(void);
SDL_DECLSPEC void *SDLCALL SDL_AndroidGetActivity(void);
void *SDL_AndroidGetActivity()
{
SDL_Unsupported();
return NULL;
}
DECLSPEC const char *SDLCALL SDL_AndroidGetExternalStoragePath(void);
SDL_DECLSPEC const char *SDLCALL SDL_AndroidGetExternalStoragePath(void);
const char* SDL_AndroidGetExternalStoragePath()
{
SDL_Unsupported();
return NULL;
}
DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state);
SDL_DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state);
int SDL_AndroidGetExternalStorageState(Uint32 *state)
{
(void)state;
return SDL_Unsupported();
}
DECLSPEC const char *SDLCALL SDL_AndroidGetInternalStoragePath(void);
SDL_DECLSPEC const char *SDLCALL SDL_AndroidGetInternalStoragePath(void);
const char *SDL_AndroidGetInternalStoragePath()
{
SDL_Unsupported();
return NULL;
}
DECLSPEC void *SDLCALL SDL_AndroidGetJNIEnv(void);
SDL_DECLSPEC void *SDLCALL SDL_AndroidGetJNIEnv(void);
void *SDL_AndroidGetJNIEnv()
{
SDL_Unsupported();
@@ -154,7 +155,7 @@ void *SDL_AndroidGetJNIEnv()
}
typedef void (SDLCALL *SDL_AndroidRequestPermissionCallback)(void *userdata, const char *permission, SDL_bool granted);
DECLSPEC int SDLCALL SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata);
SDL_DECLSPEC int SDLCALL SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata);
int SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata)
{
(void)permission;
@@ -163,7 +164,7 @@ int SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermi
return SDL_Unsupported();
}
DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
SDL_DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
int SDL_AndroidSendMessage(Uint32 command, int param)
{
(void)command;
@@ -171,7 +172,7 @@ int SDL_AndroidSendMessage(Uint32 command, int param)
return SDL_Unsupported();
}
DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
SDL_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;
@@ -182,34 +183,34 @@ int SDL_AndroidShowToast(const char* message, int duration, int gravity, int xof
return SDL_Unsupported();
}
DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
SDL_DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
int SDL_GetAndroidSDKVersion()
{
return SDL_Unsupported();
}
DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
SDL_DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
SDL_bool SDL_IsAndroidTV()
{
SDL_Unsupported();
return SDL_FALSE;
}
DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
SDL_DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
SDL_bool SDL_IsChromebook()
{
SDL_Unsupported();
return SDL_FALSE;
}
DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
SDL_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);
SDL_DECLSPEC Sint32 SDLCALL JNI_OnLoad(void *vm, void *reserved);
Sint32 JNI_OnLoad(void *vm, void *reserved)
{
(void)vm;

View File

@@ -24,8 +24,7 @@
* If not, you can special case it here by appending || defined(__YOUR_PLATFORM__) */
#if ( !defined(SDL_MAIN_NEEDED) && !defined(SDL_MAIN_AVAILABLE) ) || defined(SDL_PLATFORM_ANDROID)
DECLSPEC int
SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
{
(void)reserved;

View File

@@ -35,8 +35,8 @@ PAPPSTATE_REGISTRATION hPLM = {};
PAPPCONSTRAIN_REGISTRATION hCPLM = {};
HANDLE plmSuspendComplete = nullptr;
extern "C" DECLSPEC int
SDL_GDKGetTaskQueue(XTaskQueueHandle *outTaskQueue)
extern "C"
int SDL_GDKGetTaskQueue(XTaskQueueHandle *outTaskQueue)
{
/* If this is the first call, first create the global task queue. */
if (!GDK_GlobalTaskQueue) {
@@ -61,8 +61,8 @@ SDL_GDKGetTaskQueue(XTaskQueueHandle *outTaskQueue)
return 0;
}
extern "C" void
GDK_DispatchTaskQueue(void)
extern "C"
void GDK_DispatchTaskQueue(void)
{
/* If there is no global task queue, don't do anything.
* This gives the option to opt-out for those who want to handle everything themselves.
@@ -75,8 +75,7 @@ GDK_DispatchTaskQueue(void)
}
/* Pop up an out of memory message, returns to Windows */
extern "C" static BOOL
OutOfMemory(void)
static BOOL OutOfMemory(void)
{
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Out of memory - aborting", NULL);
return FALSE;
@@ -84,8 +83,8 @@ OutOfMemory(void)
/* Gets the arguments with GetCommandLine, converts them to argc and argv
and calls SDL_main */
extern "C" DECLSPEC int
SDL_RunApp(int, char**, SDL_main_func mainFunction, void *reserved)
extern "C"
int SDL_RunApp(int, char**, SDL_main_func mainFunction, void *reserved)
{
LPWSTR *argvw;
char **argv;
@@ -228,16 +227,16 @@ SDL_RunApp(int, char**, SDL_main_func mainFunction, void *reserved)
return result;
}
extern "C" DECLSPEC void
SDL_GDKSuspendComplete()
extern "C"
void SDL_GDKSuspendComplete()
{
if (plmSuspendComplete) {
SetEvent(plmSuspendComplete);
}
}
extern "C" DECLSPEC int
SDL_GDKGetDefaultUser(XUserHandle *outUserHandle)
extern "C"
int SDL_GDKGetDefaultUser(XUserHandle *outUserHandle)
{
XAsyncBlock block = { 0 };
HRESULT result;

View File

@@ -25,8 +25,7 @@
#include <3ds.h>
DECLSPEC int
SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
{
int result;
/* init */

View File

@@ -17,8 +17,7 @@
#include <apgtask.h>
DECLSPEC int
SDL_RunApp(int argc_, char* argv_[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc_, char* argv_[], SDL_main_func mainFunction, void * reserved)
{
(void)argc_; (void)argv_; (void)reserved;
/* Get the clean-up stack */

View File

@@ -64,8 +64,7 @@ static void deinit_drivers()
deinit_ps2_filesystem_driver();
}
DECLSPEC int
SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
{
int res;
(void)reserved;

View File

@@ -68,8 +68,7 @@ int sdl_psp_setup_callbacks(void)
return thid;
}
DECLSPEC int
SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
{
(void)reserved;
sdl_psp_setup_callbacks();

View File

@@ -403,7 +403,7 @@ static int OutOfMemory(void)
return -1;
}
DECLSPEC int MINGW32_FORCEALIGN SDL_RunApp(int _argc, char* _argv[], SDL_main_func mainFunction, void * reserved)
int MINGW32_FORCEALIGN SDL_RunApp(int _argc, char* _argv[], SDL_main_func mainFunction, void * reserved)
{
/* Gets the arguments with GetCommandLine, converts them to argc and argv

View File

@@ -27,8 +27,8 @@
int (*WINRT_SDLAppEntryPoint)(int, char **) = NULL;
extern "C" DECLSPEC int
SDL_RunApp(int, char**, SDL_main_func mainFunction, void * xamlBackgroundPanel)
extern "C"
int SDL_RunApp(int, char**, SDL_main_func mainFunction, void * xamlBackgroundPanel)
{
if (xamlBackgroundPanel) {
return SDL_WinRTInitXAMLApp(mainFunction, xamlBackgroundPanel);
@@ -40,8 +40,8 @@ SDL_RunApp(int, char**, SDL_main_func mainFunction, void * xamlBackgroundPanel)
}
}
extern "C" DECLSPEC SDL_WinRT_DeviceFamily
SDL_WinRTGetDeviceFamily()
extern "C"
SDL_WinRT_DeviceFamily SDL_WinRTGetDeviceFamily()
{
#if NTDDI_VERSION >= NTDDI_WIN10 /* !!! FIXME: I have no idea if this is the right test. This is a UWP API, I think. Older windows should...just return "mobile"? I don't know. --ryan. */
Platform::String ^ deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily;

View File

@@ -382,7 +382,7 @@ static Sint32 initialize_jumptable(Uint32 apiver, void *table, Uint32 tablesize)
/* Here's the exported entry point that fills in the jump table. */
/* Use specific types when an "int" might suffice to keep this sane. */
typedef Sint32 (SDLCALL *SDL_DYNAPI_ENTRYFN)(Uint32 apiver, void *table, Uint32 tablesize);
extern DECLSPEC Sint32 SDLCALL SDL_DYNAPI_entry(Uint32, void *, Uint32);
extern SDL_DECLSPEC Sint32 SDLCALL SDL_DYNAPI_entry(Uint32, void *, Uint32);
Sint32 SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize)
{

View File

@@ -87,7 +87,7 @@ def main():
continue
# Remove one line comment /* ... */
# eg: extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
# eg: extern SDL_DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
line = reg_comment_remove_content.sub('', line)
# Get the comment block /* ... */ across several lines
@@ -183,7 +183,7 @@ def main():
#
func_ret = func_ret.replace('extern', ' ')
func_ret = func_ret.replace('SDLCALL', ' ')
func_ret = func_ret.replace('DECLSPEC', ' ')
func_ret = func_ret.replace('SDL_DECLSPEC', ' ')
# Remove trailing spaces in front of '*'
tmp = ""
while func_ret != tmp:

View File

@@ -368,12 +368,12 @@ SDL_Thread *SDL_CreateThreadWithStackSize(int(SDLCALL *fn)(void *),
}
#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(int(SDLCALL *fn)(void *),
SDL_Thread *SDLCALL SDL_CreateThread(int(SDLCALL *fn)(void *),
const char *name, void *data,
pfnSDL_CurrentBeginThread pfnBeginThread,
pfnSDL_CurrentEndThread pfnEndThread)
#else
DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(int(SDLCALL *fn)(void *),
SDL_Thread *SDLCALL SDL_CreateThread(int(SDLCALL *fn)(void *),
const char *name, void *data)
#endif
{

View File

@@ -42,7 +42,7 @@ void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata)
#endif /* SDL_PLATFORM_WIN32 || SDL_PLATFORM_GDK */
DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
SDL_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;
@@ -52,7 +52,7 @@ SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *
return SDL_FALSE;
}
DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID);
SDL_DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID);
int SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID)
{
(void)displayID;
@@ -61,7 +61,7 @@ int SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID)
#elif defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID);
SDL_DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID);
int SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID)
{
(void)displayID;
@@ -72,7 +72,7 @@ int SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID)
#ifndef SDL_PLATFORM_GDK
DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(void *outTaskQueue);
SDL_DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(void *outTaskQueue);
int SDL_GDKGetTaskQueue(void *outTaskQueue)
{
(void)outTaskQueue;
@@ -83,7 +83,7 @@ int SDL_GDKGetTaskQueue(void *outTaskQueue)
#ifndef SDL_VIDEO_DRIVER_UIKIT
DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
void SDL_OnApplicationDidChangeStatusBarOrientation(void)
{
SDL_Unsupported();
@@ -93,7 +93,7 @@ void SDL_OnApplicationDidChangeStatusBarOrientation(void)
#ifndef SDL_VIDEO_DRIVER_UIKIT
DECLSPEC int SDLCALL SDL_iOSSetAnimationCallback(SDL_Window *window, int interval, void (*callback)(void *), void *callbackParam);
SDL_DECLSPEC int SDLCALL SDL_iOSSetAnimationCallback(SDL_Window *window, int interval, void (*callback)(void *), void *callbackParam);
int SDL_iOSSetAnimationCallback(SDL_Window *window, int interval, void (*callback)(void *), void *callbackParam)
{
(void)window;
@@ -103,7 +103,7 @@ int SDL_iOSSetAnimationCallback(SDL_Window *window, int interval, void (*callbac
return SDL_Unsupported();
}
DECLSPEC void SDLCALL SDL_iOSSetEventPump(SDL_bool enabled);
SDL_DECLSPEC void SDLCALL SDL_iOSSetEventPump(SDL_bool enabled);
void SDL_iOSSetEventPump(SDL_bool enabled)
{
(void)enabled;