Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_COCOA
This commit is contained in:
1 parent
995c345a62
commit
f14fe3f9aa
19 files changed
+29
-29
No files matched your search
+1
-1
@@ -82,7 +82,7 @@
|
||||
#define DEFAULT_OGL_ES_PVR "libGLES_CM.dll"
|
||||
#define DEFAULT_OGL_ES "libGLESv1_CM.dll"
|
||||
|
||||
#elif SDL_VIDEO_DRIVER_COCOA
|
||||
#elif defined(SDL_VIDEO_DRIVER_COCOA)
|
||||
/* EGL AND OpenGL ES support via ANGLE */
|
||||
#define DEFAULT_EGL "libEGL.dylib"
|
||||
#define DEFAULT_OGL_ES2 "libGLESv2.dylib"
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
/* Available video drivers */
|
||||
static VideoBootStrap *bootstrap[] = {
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
&COCOA_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_WAYLAND
|
||||
@@ -4659,7 +4659,7 @@ int SDL_GetMessageBoxCount(void)
|
||||
#if SDL_VIDEO_DRIVER_WINRT
|
||||
#include "winrt/SDL_winrtmessagebox.h"
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
#include "cocoa/SDL_cocoamessagebox.h"
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_UIKIT
|
||||
@@ -4681,7 +4681,7 @@ int SDL_GetMessageBoxCount(void)
|
||||
#include "vita/SDL_vitamessagebox.h"
|
||||
#endif
|
||||
|
||||
#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
|
||||
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || SDL_VIDEO_DRIVER_WINRT || defined(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;
|
||||
@@ -4760,7 +4760,7 @@ int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
|
||||
retval = 0;
|
||||
}
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
if (retval == -1 &&
|
||||
SDL_IsMessageboxValidForDriver(messageboxdata, SDL_SYSWM_COCOA) &&
|
||||
Cocoa_ShowMessageBox(messageboxdata, buttonid) == 0) {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#ifdef SDL_VIDEO_DRIVER_ANDROID
|
||||
#define VK_USE_PLATFORM_ANDROID_KHR
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
#define VK_USE_PLATFORM_METAL_EXT
|
||||
#define VK_USE_PLATFORM_MACOS_MVK
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
#include "../../events/SDL_clipboardevents_c.h"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
#include "../../events/SDL_events_c.h"
|
||||
@@ -129,9 +129,9 @@ static void Cocoa_DispatchEvent(NSEvent *theEvent)
|
||||
|
||||
- (id)init;
|
||||
- (void)localeDidChange:(NSNotification *)notification;
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath
|
||||
ofObject:(id)object
|
||||
change:(NSDictionary *)change
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath
|
||||
ofObject:(id)object
|
||||
change:(NSDictionary *)change
|
||||
context:(void *)context;
|
||||
@end
|
||||
|
||||
@@ -277,9 +277,9 @@ static void Cocoa_DispatchEvent(NSEvent *theEvent)
|
||||
SDL_SendLocaleChangedEvent();
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath
|
||||
ofObject:(id)object
|
||||
change:(NSDictionary *)change
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath
|
||||
ofObject:(id)object
|
||||
change:(NSDictionary *)change
|
||||
context:(void *)context
|
||||
{
|
||||
SDL_SetSystemTheme(Cocoa_GetSystemTheme());
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
extern int Cocoa_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#ifndef SDL_cocoametalview_h_
|
||||
#define SDL_cocoametalview_h_
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL)
|
||||
#if defined(SDL_VIDEO_DRIVER_COCOA) && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL)
|
||||
|
||||
#import "../SDL_sysvideo.h"
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#import "SDL_cocoametalview.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL)
|
||||
#if defined(SDL_VIDEO_DRIVER_COCOA) && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL)
|
||||
|
||||
#include <SDL3/SDL_syswm.h>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
||||
|
||||
#include "SDL_cocoamouse.h"
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA && SDL_VIDEO_OPENGL_EGL
|
||||
#if defined(SDL_VIDEO_DRIVER_COCOA) && SDL_VIDEO_OPENGL_EGL
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
#include "SDL_cocoaopengles.h"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
#include "SDL_cocoashape.h"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
#error SDL must be built with Objective-C ARC (automatic reference counting) enabled
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "../SDL_vulkan_internal.h"
|
||||
#include "../SDL_sysvideo.h"
|
||||
|
||||
#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA
|
||||
#if SDL_VIDEO_VULKAN && defined(SDL_VIDEO_DRIVER_COCOA)
|
||||
|
||||
int Cocoa_Vulkan_LoadLibrary(_THIS, const char *path);
|
||||
void Cocoa_Vulkan_UnloadLibrary(_THIS);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA
|
||||
#if SDL_VIDEO_VULKAN && defined(SDL_VIDEO_DRIVER_COCOA)
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
#include "SDL_cocoawindow.h"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1090
|
||||
#error SDL for macOS must be built with a 10.9 SDK or above.
|
||||
|
||||
@@ -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 defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_ANDROID) || SDL_VIDEO_DRIVER_COCOA
|
||||
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_ANDROID) || defined(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 defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_ANDROID) || SDL_VIDEO_DRIVER_COCOA
|
||||
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_ANDROID) || defined(SDL_VIDEO_DRIVER_COCOA)
|
||||
error = SDL_GetError();
|
||||
SDLTest_AssertPass("Call to SDL_GetError()");
|
||||
SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
|
||||
|
||||
Reference in new issue
Block a user