Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_ANDROID

This commit is contained in:
Anonymous Maarten
2023-03-27 14:46:08 +02:00
parent 7f68915681
commit 915d3159cf
20 changed files with 28 additions and 28 deletions

View File

@@ -245,7 +245,7 @@ static int GLES2_LoadFunctions(GLES2_RenderData *data)
{ {
#if SDL_VIDEO_DRIVER_UIKIT #if SDL_VIDEO_DRIVER_UIKIT
#define __SDL_NOGETPROCADDR__ #define __SDL_NOGETPROCADDR__
#elif SDL_VIDEO_DRIVER_ANDROID #elif defined(SDL_VIDEO_DRIVER_ANDROID)
#define __SDL_NOGETPROCADDR__ #define __SDL_NOGETPROCADDR__
#endif #endif

View File

@@ -25,7 +25,7 @@
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || SDL_VIDEO_DRIVER_WINRT #if defined(SDL_VIDEO_DRIVER_WINDOWS) || SDL_VIDEO_DRIVER_WINRT
#include "../core/windows/SDL_windows.h" #include "../core/windows/SDL_windows.h"
#endif #endif
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
#include <android/native_window.h> #include <android/native_window.h>
#include "../video/android/SDL_androidvideo.h" #include "../video/android/SDL_androidvideo.h"
#endif #endif
@@ -67,7 +67,7 @@
#define DEFAULT_OGL_ES_PVR (vc4 ? "libGLES_CM.so.1" : "libbrcmGLESv2.so") #define DEFAULT_OGL_ES_PVR (vc4 ? "libGLES_CM.so.1" : "libbrcmGLESv2.so")
#define DEFAULT_OGL_ES (vc4 ? "libGLESv1_CM.so.1" : "libbrcmGLESv2.so") #define DEFAULT_OGL_ES (vc4 ? "libGLESv1_CM.so.1" : "libbrcmGLESv2.so")
#elif SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_VIVANTE #elif defined(SDL_VIDEO_DRIVER_ANDROID) || SDL_VIDEO_DRIVER_VIVANTE
/* Android */ /* Android */
#define DEFAULT_EGL "libEGL.so" #define DEFAULT_EGL "libEGL.so"
#define DEFAULT_OGL_ES2 "libGLESv2.so" #define DEFAULT_OGL_ES2 "libGLESv2.so"
@@ -971,7 +971,7 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
share_context = (EGLContext)SDL_GL_GetCurrentContext(); share_context = (EGLContext)SDL_GL_GetCurrentContext();
} }
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
if (_this->gl_config.flags & SDL_GL_CONTEXT_DEBUG_FLAG) { if (_this->gl_config.flags & SDL_GL_CONTEXT_DEBUG_FLAG) {
/* If SDL_GL_CONTEXT_DEBUG_FLAG is set but EGL_KHR_debug unsupported, unset. /* If SDL_GL_CONTEXT_DEBUG_FLAG is set but EGL_KHR_debug unsupported, unset.
* This is required because some Android devices like to complain about it * This is required because some Android devices like to complain about it
@@ -1220,7 +1220,7 @@ int SDL_EGL_DeleteContext(_THIS, SDL_GLContext context)
EGLSurface * EGLSurface *
SDL_EGL_CreateSurface(_THIS, SDL_Window *window, NativeWindowType nw) SDL_EGL_CreateSurface(_THIS, SDL_Window *window, NativeWindowType nw)
{ {
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
EGLint format_wanted; EGLint format_wanted;
EGLint format_got; EGLint format_got;
#endif #endif
@@ -1234,7 +1234,7 @@ SDL_EGL_CreateSurface(_THIS, SDL_Window *window, NativeWindowType nw)
return EGL_NO_SURFACE; return EGL_NO_SURFACE;
} }
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
/* On Android, EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is /* On Android, EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is
* guaranteed to be accepted by ANativeWindow_setBuffersGeometry(). */ * guaranteed to be accepted by ANativeWindow_setBuffersGeometry(). */
_this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display, _this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display,
@@ -1302,7 +1302,7 @@ SDL_EGL_CreateSurface(_THIS, SDL_Window *window, NativeWindowType nw)
SDL_EGL_SetError("unable to create an EGL window surface", "eglCreateWindowSurface"); SDL_EGL_SetError("unable to create an EGL window surface", "eglCreateWindowSurface");
} }
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
format_got = ANativeWindow_getFormat(nw); format_got = ANativeWindow_getFormat(nw);
Android_SetFormat(format_wanted, format_got); Android_SetFormat(format_wanted, format_got);
#endif #endif

View File

@@ -88,7 +88,7 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_UIKIT #if SDL_VIDEO_DRIVER_UIKIT
&UIKIT_bootstrap, &UIKIT_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
&Android_bootstrap, &Android_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_PS2 #if SDL_VIDEO_DRIVER_PS2
@@ -4650,7 +4650,7 @@ int SDL_GetMessageBoxCount(void)
return SDL_AtomicGet(&SDL_messagebox_count); return SDL_AtomicGet(&SDL_messagebox_count);
} }
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
#include "android/SDL_androidmessagebox.h" #include "android/SDL_androidmessagebox.h"
#endif #endif
#ifdef SDL_VIDEO_DRIVER_WINDOWS #ifdef SDL_VIDEO_DRIVER_WINDOWS
@@ -4740,7 +4740,7 @@ int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
} }
/* It's completely fine to call this function before video is initialized */ /* It's completely fine to call this function before video is initialized */
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
if (retval == -1 && if (retval == -1 &&
Android_ShowMessageBox(messageboxdata, buttonid) == 0) { Android_ShowMessageBox(messageboxdata, buttonid) == 0) {
retval = 0; retval = 0;

View File

@@ -28,7 +28,7 @@
#error You should not be here. #error You should not be here.
#endif #endif
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
#define VK_USE_PLATFORM_ANDROID_KHR #define VK_USE_PLATFORM_ANDROID_KHR
#endif #endif
#if SDL_VIDEO_DRIVER_COCOA #if SDL_VIDEO_DRIVER_COCOA

View File

@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
#include "SDL_androidvideo.h" #include "SDL_androidvideo.h"
#include "SDL_androidclipboard.h" #include "SDL_androidclipboard.h"

View File

@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
#include "SDL_androidevents.h" #include "SDL_androidevents.h"
#include "SDL_androidkeyboard.h" #include "SDL_androidkeyboard.h"

View File

@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_ANDROID && SDL_VIDEO_OPENGL_EGL #if defined(SDL_VIDEO_DRIVER_ANDROID) && SDL_VIDEO_OPENGL_EGL
/* Android SDL video driver implementation */ /* Android SDL video driver implementation */

View File

@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
#include <android/log.h> #include <android/log.h>

View File

@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
#include "SDL_androidmessagebox.h" #include "SDL_androidmessagebox.h"
#include "../../core/android/SDL_android.h" #include "../../core/android/SDL_android.h"

View File

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

View File

@@ -21,7 +21,7 @@
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
#include "SDL_androidmouse.h" #include "SDL_androidmouse.h"

View File

@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
#include <android/log.h> #include <android/log.h>

View File

@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
/* Android SDL video driver implementation */ /* Android SDL video driver implementation */

View File

@@ -26,7 +26,7 @@
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_ANDROID #if SDL_VIDEO_VULKAN && defined(SDL_VIDEO_DRIVER_ANDROID)
#include "SDL_androidvideo.h" #include "SDL_androidvideo.h"
#include "SDL_androidwindow.h" #include "SDL_androidwindow.h"

View File

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

View File

@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
#include "../SDL_sysvideo.h" #include "../SDL_sysvideo.h"
#include "../../events/SDL_keyboard_c.h" #include "../../events/SDL_keyboard_c.h"

View File

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

View File

@@ -36,7 +36,7 @@ static int LoadContext(GL_Context *data)
{ {
#if SDL_VIDEO_DRIVER_UIKIT #if SDL_VIDEO_DRIVER_UIKIT
#define __SDL_NOGETPROCADDR__ #define __SDL_NOGETPROCADDR__
#elif SDL_VIDEO_DRIVER_ANDROID #elif defined(SDL_VIDEO_DRIVER_ANDROID)
#define __SDL_NOGETPROCADDR__ #define __SDL_NOGETPROCADDR__
#endif #endif

View File

@@ -62,7 +62,7 @@ static int LoadContext(GLES2_Context *data)
{ {
#if SDL_VIDEO_DRIVER_UIKIT #if SDL_VIDEO_DRIVER_UIKIT
#define __SDL_NOGETPROCADDR__ #define __SDL_NOGETPROCADDR__
#elif SDL_VIDEO_DRIVER_ANDROID #elif defined(SDL_VIDEO_DRIVER_ANDROID)
#define __SDL_NOGETPROCADDR__ #define __SDL_NOGETPROCADDR__
#endif #endif

View File

@@ -64,7 +64,7 @@ static int LoadContext(GLES2_Context *data)
{ {
#if SDL_VIDEO_DRIVER_UIKIT #if SDL_VIDEO_DRIVER_UIKIT
#define __SDL_NOGETPROCADDR__ #define __SDL_NOGETPROCADDR__
#elif SDL_VIDEO_DRIVER_ANDROID #elif defined(SDL_VIDEO_DRIVER_ANDROID)
#define __SDL_NOGETPROCADDR__ #define __SDL_NOGETPROCADDR__
#endif #endif