mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-05 05:24:42 +00:00
windows: Clean out things that should be using defined(SDL_PLATFORM_WINDOWS).
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
#include "SDL_internal.h"
|
||||
#include "SDL3/SDL_revision.h"
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
#include "core/windows/SDL_windows.h"
|
||||
#else
|
||||
#include <unistd.h> // _exit(), etc.
|
||||
@@ -86,7 +86,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_MICRO_VERSION_max, SDL_MICRO_VERSION <= 999);
|
||||
extern SDL_NORETURN void SDL_ExitProcess(int exitcode);
|
||||
SDL_NORETURN void SDL_ExitProcess(int exitcode)
|
||||
{
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
/* "if you do not know the state of all threads in your process, it is
|
||||
better to call TerminateProcess than ExitProcess"
|
||||
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682658(v=vs.85).aspx */
|
||||
@@ -752,4 +752,4 @@ BOOL APIENTRY MINGW32_FORCEALIGN _DllMainCRTStartup(HANDLE hModule, DWORD ul_rea
|
||||
}
|
||||
#endif // Building DLL
|
||||
|
||||
#endif // defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#endif // defined(SDL_PLATFORM_WIN32)
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
#include "core/windows/SDL_windows.h"
|
||||
#endif
|
||||
|
||||
#include "SDL_assert_c.h"
|
||||
#include "video/SDL_sysvideo.h"
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
#ifndef WS_OVERLAPPEDWINDOW
|
||||
#define WS_OVERLAPPEDWINDOW 0
|
||||
#endif
|
||||
@@ -86,7 +86,7 @@ static void SDL_AddAssertionToReport(SDL_AssertData *data)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
#define ENDLINE "\r\n"
|
||||
#else
|
||||
#define ENDLINE "\n"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
#include "core/windows/SDL_windows.h"
|
||||
#endif
|
||||
|
||||
@@ -526,7 +526,7 @@ static HANDLE stderrHandle = NULL;
|
||||
static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
|
||||
const char *message)
|
||||
{
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
// Way too many allocations here, urgh
|
||||
// Note: One can't call SDL_SetError here, since that function itself logs.
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
#include "../core/windows/SDL_windows.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ void SDL_GDKResumeGPU(SDL_GPUDevice *device)
|
||||
|
||||
#endif
|
||||
|
||||
#if !(defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK))
|
||||
#if !defined(SDL_PLATFORM_WINDOWS)
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
|
||||
SDL_bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) && defined(HAVE_MMDEVICEAPI_H)
|
||||
#if defined(SDL_PLATFORM_WINDOWS) && defined(HAVE_MMDEVICEAPI_H)
|
||||
|
||||
#include "SDL_windows.h"
|
||||
#include "SDL_immdevice.h"
|
||||
@@ -431,4 +431,4 @@ void SDL_IMMDevice_EnumerateEndpoints(SDL_AudioDevice **default_playback, SDL_Au
|
||||
IMMDeviceEnumerator_RegisterEndpointNotificationCallback(enumerator, (IMMNotificationClient *)¬ification_client);
|
||||
}
|
||||
|
||||
#endif // (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) && defined(HAVE_MMDEVICEAPI_H)
|
||||
#endif // defined(SDL_PLATFORM_WINDOWS) && defined(HAVE_MMDEVICEAPI_H)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
|
||||
#include "SDL_windows.h"
|
||||
|
||||
@@ -372,4 +372,4 @@ int WIN_WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWCH lpWideCharStr,
|
||||
return WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte, lpDefaultChar, lpUsedDefaultChar);
|
||||
}
|
||||
|
||||
#endif // defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#endif // defined(SDL_PLATFORM_WINDOWS)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "SDL_cpuinfo_c.h"
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
#include "../core/windows/SDL_windows.h"
|
||||
#endif
|
||||
|
||||
@@ -636,7 +636,7 @@ int SDL_GetCPUCount(void)
|
||||
sysctlbyname("hw.ncpu", &SDL_CPUCount, &size, NULL, 0);
|
||||
}
|
||||
#endif
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
if (SDL_CPUCount <= 0) {
|
||||
SYSTEM_INFO info;
|
||||
GetSystemInfo(&info);
|
||||
@@ -1138,7 +1138,7 @@ int SDL_GetSystemRAM(void)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
if (SDL_SystemRAM <= 0) {
|
||||
MEMORYSTATUSEX stat;
|
||||
stat.dwLength = sizeof(stat);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#define SDL_dynapi_unsupported_h_
|
||||
|
||||
|
||||
#if !(defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK))
|
||||
#if !defined(SDL_PLATFORM_WINDOWS)
|
||||
typedef struct ID3D12Device ID3D12Device;
|
||||
typedef void *SDL_WindowsMessageHook;
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "../video/SDL_sysvideo.h"
|
||||
#include "SDL_events_c.h"
|
||||
#include "SDL_mouse_c.h"
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
#include "../core/windows/SDL_windows.h" // For GetDoubleClickTime()
|
||||
#endif
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
#include "../core/windows/SDL_windows.h"
|
||||
#endif
|
||||
|
||||
@@ -54,7 +54,7 @@ struct SDL_IOStream
|
||||
#include "../core/android/SDL_android.h"
|
||||
#endif
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
|
||||
typedef struct IOStreamWindowsData
|
||||
{
|
||||
@@ -276,9 +276,9 @@ static SDL_bool SDLCALL windows_file_close(void *userdata)
|
||||
SDL_free(iodata);
|
||||
return true;
|
||||
}
|
||||
#endif // defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#endif // defined(SDL_PLATFORM_WINDOWS)
|
||||
|
||||
#if defined(HAVE_STDIO_H) && !(defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK))
|
||||
#if defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINDOWS)
|
||||
|
||||
// Functions to read/write stdio file pointers. Not used for windows.
|
||||
|
||||
@@ -429,7 +429,7 @@ static SDL_IOStream *SDL_IOFromFP(FILE *fp, bool autoclose)
|
||||
|
||||
return iostr;
|
||||
}
|
||||
#endif // !HAVE_STDIO_H && !(SDL_PLATFORM_WIN32 || SDL_PLATFORM_GDK)
|
||||
#endif // !HAVE_STDIO_H && !defined(SDL_PLATFORM_WINDOWS)
|
||||
|
||||
// Functions to read/write memory pointers
|
||||
|
||||
@@ -604,7 +604,7 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode)
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#elif defined(SDL_PLATFORM_WINDOWS)
|
||||
IOStreamWindowsData *iodata = (IOStreamWindowsData *) SDL_malloc(sizeof (*iodata));
|
||||
if (!iodata) {
|
||||
return NULL;
|
||||
|
||||
@@ -787,16 +787,12 @@ done:
|
||||
return result;
|
||||
}
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
|
||||
|
||||
static DXGI_MODE_ROTATION D3D11_GetCurrentRotation(void)
|
||||
{
|
||||
// FIXME
|
||||
return DXGI_MODE_ROTATION_IDENTITY;
|
||||
}
|
||||
|
||||
#endif // defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
|
||||
|
||||
static BOOL D3D11_IsDisplayRotated90Degrees(DXGI_MODE_ROTATION rotation)
|
||||
{
|
||||
switch (rotation) {
|
||||
|
||||
@@ -32,7 +32,7 @@ Andreas Schiffler -- aschiffler at ferzkopp dot net
|
||||
|
||||
#ifdef SDL_VIDEO_RENDER_SW
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ static struct
|
||||
{ "US-ASCII", ENCODING_ASCII },
|
||||
{ "8859-1", ENCODING_LATIN1 },
|
||||
{ "ISO-8859-1", ENCODING_LATIN1 },
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_OS2) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS) || defined(SDL_PLATFORM_OS2)
|
||||
{ "WCHAR_T", ENCODING_UTF16LE },
|
||||
#else
|
||||
{ "WCHAR_T", ENCODING_UCS4NATIVE },
|
||||
|
||||
@@ -340,7 +340,7 @@ SDL_Thread *SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props,
|
||||
SDL_FunctionPointer pfnEndThread)
|
||||
{
|
||||
// rather than check this in every backend, just make sure it's correct upfront. Only allow non-NULL if Windows, or Microsoft GDK.
|
||||
#if (!defined(SDL_PLATFORM_WIN32) && !defined(SDL_PLATFORM_GDK))
|
||||
#if !defined(SDL_PLATFORM_WINDOWS)
|
||||
if (pfnBeginThread || pfnEndThread) {
|
||||
SDL_SetError("_beginthreadex/_endthreadex not supported on this platform");
|
||||
return NULL;
|
||||
|
||||
@@ -2411,7 +2411,7 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
|
||||
/* Clear minimized if not on windows, only windows handles it at create rather than FinishWindowCreation,
|
||||
* but it's important or window focus will get broken on windows!
|
||||
*/
|
||||
#if !defined(SDL_PLATFORM_WIN32) && !defined(SDL_PLATFORM_GDK)
|
||||
#if !defined(SDL_PLATFORM_WINDOWS)
|
||||
if (window->flags & SDL_WINDOW_MINIMIZED) {
|
||||
window->flags &= ~SDL_WINDOW_MINIMIZED;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#ifndef SDL_VIDEO_DRIVER_WINDOWS
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
|
||||
SDL_bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
|
||||
{
|
||||
@@ -40,7 +40,7 @@ void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // SDL_PLATFORM_WIN32 || SDL_PLATFORM_GDK
|
||||
#endif // defined(SDL_PLATFORM_WINDOWS)
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
|
||||
SDL_bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex)
|
||||
|
||||
Reference in New Issue
Block a user