windows: Clean out things that should be using defined(SDL_PLATFORM_WINDOWS).

This commit is contained in:
Ryan C. Gordon
2024-09-05 23:59:23 -04:00
parent 154452a726
commit ac08dde1b2
23 changed files with 47 additions and 54 deletions

View File

@@ -53,7 +53,7 @@
/* Some compilers use a special export keyword */
#ifndef SDL_DECLSPEC
# if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_CYGWIN) || defined(SDL_PLATFORM_GDK)
# if defined(SDL_PLATFORM_WINDOWS)
# ifdef DLL_EXPORT
# define SDL_DECLSPEC __declspec(dllexport)
# else
@@ -70,7 +70,7 @@
/* By default SDL uses the C calling convention */
#ifndef SDLCALL
#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) && !defined(__GNUC__)
#if defined(SDL_PLATFORM_WINDOWS) && !defined(__GNUC__)
#define SDLCALL __cdecl
#else
#define SDLCALL

View File

@@ -503,7 +503,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RunApp(int argc, char *argv[], SDL_main_func
extern SDL_DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit);
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
#if defined(SDL_PLATFORM_WINDOWS)
/**
* Register a win32 window class for SDL's use.
@@ -548,7 +548,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RegisterApp(const char *name, Uint32 st
*/
extern SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void);
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) */
#endif /* defined(SDL_PLATFORM_WINDOWS) */
#ifdef SDL_PLATFORM_GDK
@@ -570,7 +570,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
#if !defined(SDL_MAIN_HANDLED) && !defined(SDL_MAIN_NOIMPL)
/* include header-only SDL_main implementations */
#if defined(SDL_MAIN_USE_CALLBACKS) \
|| defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS) \
|| defined(SDL_PLATFORM_WINDOWS) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS) \
|| defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) \
|| defined(SDL_PLATFORM_EMSCRIPTEN)

View File

@@ -67,7 +67,7 @@
/* set up the usual SDL_main stuff if we're not using callbacks or if we are but need the normal entry point. */
#if !defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_CALLBACK_STANDARD)
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
#if defined(SDL_PLATFORM_WINDOWS)
/* these defines/typedefs are needed for the WinMain() definition */
#ifndef WINAPI
@@ -124,7 +124,7 @@
} /* extern "C" */
#endif
/* end of SDL_PLATFORM_WIN32 and SDL_PLATFORM_GDK impls */
/* end of SDL_PLATFORM_WINDOWS impls */
#elif defined(SDL_PLATFORM_NGAGE)
/* same typedef as in ngage SDKs e32def.h */

View File

@@ -336,7 +336,7 @@ typedef Sint64 SDL_Time;
* <stdint.h> should define these but this is not true all platforms.
* (for example win32) */
#ifndef SDL_PRIs64
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
#if defined(SDL_PLATFORM_WINDOWS)
#define SDL_PRIs64 "I64d"
#elif defined(PRIs64)
#define SDL_PRIs64 PRIs64
@@ -347,7 +347,7 @@ typedef Sint64 SDL_Time;
#endif
#endif
#ifndef SDL_PRIu64
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
#if defined(SDL_PLATFORM_WINDOWS)
#define SDL_PRIu64 "I64u"
#elif defined(PRIu64)
#define SDL_PRIu64 PRIu64
@@ -358,7 +358,7 @@ typedef Sint64 SDL_Time;
#endif
#endif
#ifndef SDL_PRIx64
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
#if defined(SDL_PLATFORM_WINDOWS)
#define SDL_PRIx64 "I64x"
#elif defined(PRIx64)
#define SDL_PRIx64 PRIx64
@@ -369,7 +369,7 @@ typedef Sint64 SDL_Time;
#endif
#endif
#ifndef SDL_PRIX64
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
#if defined(SDL_PLATFORM_WINDOWS)
#define SDL_PRIX64 "I64X"
#elif defined(PRIX64)
#define SDL_PRIX64 PRIX64

View File

@@ -44,7 +44,7 @@ extern "C" {
/*
* Platform specific functions for Windows
*/
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
#if defined(SDL_PLATFORM_WINDOWS)
typedef struct tagMSG MSG;
@@ -90,7 +90,7 @@ typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
*/
extern SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) */
#endif /* defined(SDL_PLATFORM_WINDOWS) */
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
@@ -108,10 +108,6 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHoo
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID);
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
/**
* Get the DXGI Adapter and Output indices for the specified display.
*
@@ -131,6 +127,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID display
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
/*
* Platform specific functions for UNIX
*/

View File

@@ -36,7 +36,7 @@
#include <SDL3/SDL_atomic.h>
#include <SDL3/SDL_mutex.h>
#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK))
#if defined(SDL_PLATFORM_WINDOWS)
#include <process.h> /* _beginthreadex() and _endthreadex() */
#endif
@@ -263,7 +263,7 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithProperties(SDL_Prop
/* The real implementation, hidden from the wiki, so it can show this as real functions that don't have macro magic. */
#ifndef SDL_WIKI_DOCUMENTATION_SECTION
# if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK))
# if defined(SDL_PLATFORM_WINDOWS)
# ifndef SDL_BeginThreadFunction
# define SDL_BeginThreadFunction _beginthreadex
# endif