sdl12-compat: Check for undefined TARGET_OS_*

From 619b3d89e943405547a16ccdd68c5b6f14f9bb95 Mon Sep 17 00:00:00 2001
From: Joshua Root <[EMAIL REDACTED]>
Date: Sat, 27 May 2023 22:27:36 +1000
Subject: [PATCH] Check for undefined TARGET_OS_*

Prevents some versions of clang from erroring out like this:

error: ‘TARGET_OS_TV’ is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]

---
 include/SDL/SDL_platform.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/SDL/SDL_platform.h b/include/SDL/SDL_platform.h
index 850bcca27..63149f8d8 100644
--- a/include/SDL/SDL_platform.h
+++ b/include/SDL/SDL_platform.h
@@ -72,11 +72,11 @@ requirement is dropped too. Send patches. :) */
 /* lets us know what version of Mac OS X we're compiling on */
 #include "AvailabilityMacros.h"
 #include "TargetConditionals.h"
-#if TARGET_OS_TV
+#if defined(TARGET_OS_TV) && TARGET_OS_TV
 #undef __TVOS__
 #define __TVOS__ 1
 #endif
-#if TARGET_OS_IPHONE
+#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
 /* if compiling for iOS */
 #undef __IPHONEOS__
 #define __IPHONEOS__ 1