From 2ed541237808b584962cb0ae7485ee3d31a1ca45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20Mu=CC=88ller?= <znek@mulle-kybernetik.com>
Date: Fri, 16 Aug 2024 16:38:32 +0200
Subject: [PATCH] Fix build issues for macOS < 10.12

---
 MKConsoleWindow.m | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/MKConsoleWindow.m b/MKConsoleWindow.m
index 6325289..26e5a54 100644
--- MKConsoleWindow.m
+++ MKConsoleWindow.m
@@ -46,9 +46,17 @@
     @implementation MKConsoleWindow
 //---------------------------------------------------------------------------------------
 
+// NOTE: can't use version macro(s) `MAC_OS_VERSION_12_0`/`__MAC_10_12` when
+// compiling on older platforms as it's undefined there - using its value
+// instead!
+#if (MAC_OS_X_VERSION_MAX_ALLOWED < 101200)
+#define NSWindowStyleMaskBorderless NSBorderlessWindowMask
+#define NSWindowStyleMask NSUInteger
+#endif
+
 - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag
 {
-    self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
+    self = [super initWithContentRect:contentRect styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
     NSAssert1(self != nil, @"%s Failed to create window instance", __PRETTY_FUNCTION__);
     return self;
 }
