SDL: Fixed building with an older macOS SDK

From 1673d52351e7d7191f927517eab9ffd906ba1b14 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 7 Feb 2024 13:49:42 -0800
Subject: [PATCH] Fixed building with an older macOS SDK

---
 src/video/cocoa/SDL_cocoamodes.m | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/video/cocoa/SDL_cocoamodes.m b/src/video/cocoa/SDL_cocoamodes.m
index ba9235962291..fa6215e6a813 100644
--- a/src/video/cocoa/SDL_cocoamodes.m
+++ b/src/video/cocoa/SDL_cocoamodes.m
@@ -295,6 +295,7 @@ static void Cocoa_GetHDRProperties(CGDirectDisplayID displayID, SDL_HDRDisplayPr
     HDR->enabled = SDL_FALSE;
     HDR->SDR_whitelevel = 0.0f;
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101500 /* Added in the 10.15 SDK */
     if (@available(macOS 10.15, *)) {
         NSScreen *screen = GetNSScreenForDisplayID(displayID);
 
@@ -303,6 +304,7 @@ static void Cocoa_GetHDRProperties(CGDirectDisplayID displayID, SDL_HDRDisplayPr
             HDR->SDR_whitelevel = 80.0f; /* SDR content is always at scRGB 1.0 */
         }
     }
+#endif
 }
 
 void Cocoa_InitModes(SDL_VideoDevice *_this)