From 4bf650d488dce2a2f5d6437f9b3c15b124a30537 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 27 Mar 2023 15:03:41 +0200 Subject: [PATCH] Fix -Wundef warnings due to use of unguarded __IOS__ --- src/SDL.c | 2 +- src/hidapi/SDL_hidapi.c | 4 ++-- src/hidapi/hidapi/hidapi.h | 2 +- src/video/SDL_video.c | 4 ++-- test/checkkeys.c | 2 +- test/checkkeysthreads.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/SDL.c b/src/SDL.c index 375d1a1c19..0a9679447b 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -623,7 +623,7 @@ SDL_IsTablet(void) #if defined(__ANDROID__) extern SDL_bool SDL_IsAndroidTablet(void); return SDL_IsAndroidTablet(); -#elif __IOS__ +#elif defined(__IOS__) extern SDL_bool SDL_IsIPad(void); return SDL_IsIPad(); #else diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c index 1a1e12c866..95d845c9b0 100644 --- a/src/hidapi/SDL_hidapi.c +++ b/src/hidapi/SDL_hidapi.c @@ -595,7 +595,7 @@ static const SDL_UDEV_Symbols *udev_ctx = NULL; #include "hidapi/hidapi.h" #define HAVE_PLATFORM_BACKEND 1 #define udev_ctx 1 -#elif __IOS__ || __TVOS__ +#elif defined(__IOS__) || __TVOS__ /* The implementation for iOS and tvOS is in a separate .m file */ #include "hidapi/hidapi.h" #define HAVE_PLATFORM_BACKEND 1 @@ -1585,7 +1585,7 @@ int SDL_hid_get_indexed_string(SDL_hid_device *device, int string_index, wchar_t void SDL_hid_ble_scan(SDL_bool active) { -#if !SDL_HIDAPI_DISABLED && (__IOS__ || __TVOS__) +#if !SDL_HIDAPI_DISABLED && (defined(__IOS__) || __TVOS__) hid_ble_scan(active); #endif } diff --git a/src/hidapi/hidapi/hidapi.h b/src/hidapi/hidapi/hidapi.h index f20de73f68..dfe10fdc04 100644 --- a/src/hidapi/hidapi/hidapi.h +++ b/src/hidapi/hidapi/hidapi.h @@ -406,7 +406,7 @@ namespace NAMESPACE { */ HID_API_EXPORT const wchar_t* HID_API_CALL hid_error(hid_device *dev); -#if __IOS__ || __TVOS__ +#if defined(__IOS__) || __TVOS__ HID_API_EXPORT void HID_API_CALL hid_ble_scan(int active); #endif diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index e1a248c724..215198637e 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -192,12 +192,12 @@ typedef struct static Uint32 SDL_DefaultGraphicsBackends(SDL_VideoDevice *_this) { -#if (SDL_VIDEO_OPENGL && __MACOS__) || (__IOS__ && !TARGET_OS_MACCATALYST) || defined(__ANDROID__) +#if (SDL_VIDEO_OPENGL && __MACOS__) || (defined(__IOS__) && !TARGET_OS_MACCATALYST) || defined(__ANDROID__) if (_this->GL_CreateContext != NULL) { return SDL_WINDOW_OPENGL; } #endif -#if SDL_VIDEO_METAL && (TARGET_OS_MACCATALYST || __MACOS__ || __IOS__) +#if SDL_VIDEO_METAL && (TARGET_OS_MACCATALYST || __MACOS__ || defined(__IOS__)) if (_this->Metal_CreateView != NULL) { return SDL_WINDOW_METAL; } diff --git a/test/checkkeys.c b/test/checkkeys.c index dccd67291e..bc4d7f1262 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -294,7 +294,7 @@ int main(int argc, char *argv[]) textwin = SDLTest_TextWindowCreate(0, 0, 640, 480); -#if __IOS__ +#ifdef __IOS__ /* Creating the context creates the view, which we need to show keyboard */ SDL_GL_CreateContext(window); #endif diff --git a/test/checkkeysthreads.c b/test/checkkeysthreads.c index 8a058a0a5f..23b93ebeae 100644 --- a/test/checkkeysthreads.c +++ b/test/checkkeysthreads.c @@ -277,7 +277,7 @@ int main(int argc, char *argv[]) renderer = SDL_CreateRenderer(window, NULL, 0); SDL_RenderPresent(renderer); -#if __IOS__ +#ifdef __IOS__ /* Creating the context creates the view, which we need to show keyboard */ SDL_GL_CreateContext(window); #endif