Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WINDOWS

This commit is contained in:
Anonymous Maarten
2023-03-27 14:43:08 +02:00
parent 4e5f9b0419
commit 7f68915681
21 changed files with 31 additions and 31 deletions

View File

@@ -50,7 +50,7 @@
#if !SDL_TIMERS_DISABLED
#include "timer/SDL_timer_c.h"
#endif
#if SDL_VIDEO_DRIVER_WINDOWS
#ifdef SDL_VIDEO_DRIVER_WINDOWS
extern int SDL_HelperWindowCreate(void);
extern int SDL_HelperWindowDestroy(void);
#endif
@@ -185,7 +185,7 @@ int SDL_InitSubSystem(Uint32 flags)
flags |= SDL_INIT_EVENTS;
}
#if SDL_VIDEO_DRIVER_WINDOWS
#ifdef SDL_VIDEO_DRIVER_WINDOWS
if (flags & (SDL_INIT_HAPTIC | SDL_INIT_JOYSTICK)) {
if (SDL_HelperWindowCreate() < 0) {
goto quit_and_error;
@@ -484,7 +484,7 @@ void SDL_Quit(void)
SDL_bInMainQuit = SDL_TRUE;
/* Quit all subsystems */
#if SDL_VIDEO_DRIVER_WINDOWS
#ifdef SDL_VIDEO_DRIVER_WINDOWS
SDL_HelperWindowDestroy();
#endif
SDL_QuitSubSystem(SDL_INIT_EVERYTHING);

View File

@@ -1173,7 +1173,7 @@ SDLTest_CommonInit(SDLTest_CommonState *state)
const SDL_DisplayMode *mode;
int bpp;
Uint32 Rmask, Gmask, Bmask, Amask;
#if SDL_VIDEO_DRIVER_WINDOWS
#ifdef SDL_VIDEO_DRIVER_WINDOWS
int adapterIndex = 0;
int outputIndex = 0;
#endif
@@ -1235,7 +1235,7 @@ SDLTest_CommonInit(SDLTest_CommonState *state)
}
SDL_free((void *)modes);
#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
/* Print the D3D9 adapter index */
adapterIndex = SDL_Direct3D9GetAdapterIndex(displayID);
SDL_Log("D3D9 Adapter Index: %d", adapterIndex);

View File

@@ -22,7 +22,7 @@
#if SDL_VIDEO_OPENGL_EGL
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || SDL_VIDEO_DRIVER_WINRT
#include "../core/windows/SDL_windows.h"
#endif
#if SDL_VIDEO_DRIVER_ANDROID
@@ -74,7 +74,7 @@
#define DEFAULT_OGL_ES_PVR "libGLES_CM.so"
#define DEFAULT_OGL_ES "libGLESv1_CM.so"
#elif SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
#elif defined(SDL_VIDEO_DRIVER_WINDOWS) || SDL_VIDEO_DRIVER_WINRT
/* EGL AND OpenGL ES support via ANGLE */
#define DEFAULT_EGL "libEGL.dll"
#define DEFAULT_OGL "opengl32.dll"
@@ -301,14 +301,14 @@ static int SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path)
{
void *egl_dll_handle = NULL, *opengl_dll_handle = NULL;
const char *path = NULL;
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || SDL_VIDEO_DRIVER_WINRT
const char *d3dcompiler;
#endif
#if SDL_VIDEO_DRIVER_RPI
SDL_bool vc4 = (0 == access("/sys/module/vc4/", F_OK));
#endif
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || SDL_VIDEO_DRIVER_WINRT
d3dcompiler = SDL_GetHint(SDL_HINT_VIDEO_WIN_D3DCOMPILER);
if (d3dcompiler) {
if (SDL_strcasecmp(d3dcompiler, "none") != 0) {

View File

@@ -76,7 +76,7 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_VIVANTE
&VIVANTE_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_WINDOWS
#ifdef SDL_VIDEO_DRIVER_WINDOWS
&WINDOWS_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_WINRT
@@ -4653,7 +4653,7 @@ int SDL_GetMessageBoxCount(void)
#if SDL_VIDEO_DRIVER_ANDROID
#include "android/SDL_androidmessagebox.h"
#endif
#if SDL_VIDEO_DRIVER_WINDOWS
#ifdef SDL_VIDEO_DRIVER_WINDOWS
#include "windows/SDL_windowsmessagebox.h"
#endif
#if SDL_VIDEO_DRIVER_WINRT
@@ -4681,7 +4681,7 @@ int SDL_GetMessageBoxCount(void)
#include "vita/SDL_vitamessagebox.h"
#endif
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT || SDL_VIDEO_DRIVER_COCOA || SDL_VIDEO_DRIVER_UIKIT || SDL_VIDEO_DRIVER_X11 || SDL_VIDEO_DRIVER_WAYLAND || SDL_VIDEO_DRIVER_HAIKU || SDL_VIDEO_DRIVER_RISCOS
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || SDL_VIDEO_DRIVER_WINRT || SDL_VIDEO_DRIVER_COCOA || SDL_VIDEO_DRIVER_UIKIT || SDL_VIDEO_DRIVER_X11 || SDL_VIDEO_DRIVER_WAYLAND || SDL_VIDEO_DRIVER_HAIKU || SDL_VIDEO_DRIVER_RISCOS
static SDL_bool SDL_IsMessageboxValidForDriver(const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype)
{
SDL_SysWMinfo info;
@@ -4746,7 +4746,7 @@ int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
retval = 0;
}
#endif
#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
if (retval == -1 &&
SDL_IsMessageboxValidForDriver(messageboxdata, SDL_SYSWM_WINDOWS) &&
WIN_ShowMessageBox(messageboxdata, buttonid) == 0) {

View File

@@ -43,7 +43,7 @@
#define VK_USE_PLATFORM_WAYLAND_KHR
#include "wayland/SDL_waylanddyn.h"
#endif
#if SDL_VIDEO_DRIVER_WINDOWS
#ifdef SDL_VIDEO_DRIVER_WINDOWS
#define VK_USE_PLATFORM_WIN32_KHR
#include "../core/windows/SDL_windows.h"
#endif

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#include "SDL_windowsvideo.h"
#include "SDL_windowswindow.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS
#ifdef SDL_VIDEO_DRIVER_WINDOWS
#include "SDL_windowsvideo.h"
#include "SDL_windowsshape.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#include "SDL_windowsvideo.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#include "SDL_windowsvideo.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#ifdef HAVE_LIMITS_H
#include <limits.h>

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS
#ifdef SDL_VIDEO_DRIVER_WINDOWS
extern int WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#include "SDL_windowsvideo.h"
#include "../../events/SDL_displayevents_c.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#include "SDL_windowsvideo.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS
#ifdef SDL_VIDEO_DRIVER_WINDOWS
#include "SDL_windowsvideo.h"
#include "SDL_windowsopengles.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS && SDL_VIDEO_OPENGL_EGL && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_DRIVER_WINDOWS) && SDL_VIDEO_OPENGL_EGL && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#include "SDL_windowsvideo.h"
#include "SDL_windowsopengles.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#include "SDL_windowsshape.h"
#include "SDL_windowsvideo.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS
#ifdef SDL_VIDEO_DRIVER_WINDOWS
#include "../SDL_sysvideo.h"
#include "../SDL_pixels_c.h"

View File

@@ -26,7 +26,7 @@
#include "SDL_internal.h"
#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_WINDOWS
#if SDL_VIDEO_VULKAN && defined(SDL_VIDEO_DRIVER_WINDOWS)
#include "SDL_windowsvideo.h"
#include "SDL_windowswindow.h"

View File

@@ -32,7 +32,7 @@
#include "../SDL_vulkan_internal.h"
#include "../SDL_sysvideo.h"
#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_WINDOWS
#if SDL_VIDEO_VULKAN && defined(SDL_VIDEO_DRIVER_WINDOWS)
int WIN_Vulkan_LoadLibrary(_THIS, const char *path);
void WIN_Vulkan_UnloadLibrary(_THIS);

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINDOWS
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
#include "../../core/windows/SDL_windows.h"

View File

@@ -461,7 +461,7 @@ static int keyboard_setTextInputRect(void *arg)
static int keyboard_setTextInputRectNegative(void *arg)
{
/* Some platforms set also an error message; prepare for checking it */
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA
const char *expectedError = "Parameter 'rect' is invalid";
const char *error;
@@ -474,7 +474,7 @@ static int keyboard_setTextInputRectNegative(void *arg)
SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)");
/* Some platforms set also an error message; so check it */
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA
error = SDL_GetError();
SDLTest_AssertPass("Call to SDL_GetError()");
SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");