From c083c5bb5bd53903168b36eb1040ac2d508a7193 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Wed, 22 Jan 2025 21:13:28 -0800 Subject: [PATCH] Fix code to be buildable on Xcode 8 again We added code to rely on MAC_OS_X_VERSION_10_15, and therefore need to add stub for that to make it buildable on older Xcode versions. Use this opportunity to add the other missing ones to prevent future mistakes. --- src/MacVim/MMCoreTextView.h | 2 ++ src/MacVim/MMCoreTextView.m | 2 ++ src/MacVim/MacVim.h | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/src/MacVim/MMCoreTextView.h b/src/MacVim/MMCoreTextView.h index 42a246f3e4..6dd64125d4 100644 --- a/src/MacVim/MMCoreTextView.h +++ b/src/MacVim/MMCoreTextView.h @@ -88,7 +88,9 @@ NS_ASSUME_NONNULL_BEGIN // NSFontChanging methods // - (void)changeFont:(nullable id)sender; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 - (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel; +#endif // // NSMenuItemValidation diff --git a/src/MacVim/MMCoreTextView.m b/src/MacVim/MMCoreTextView.m index 81b21d2750..44794a665c 100644 --- a/src/MacVim/MMCoreTextView.m +++ b/src/MacVim/MMCoreTextView.m @@ -1355,6 +1355,7 @@ - (void)changeFont:(id)sender } } +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 - (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel { // Lets the user pick only the font face / size, as other properties as not @@ -1362,6 +1363,7 @@ - (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel // Otherwise it could just be white text on white background in the preview. return NSFontPanelModesMaskStandardModes & (~NSFontPanelModeMaskAllEffects | NSFontPanelModeMaskTextColorEffect | NSFontPanelModeMaskDocumentColorEffect); } +#endif /// Specifies whether the menu item should be enabled/disabled. - (BOOL)validateMenuItem:(NSMenuItem *)item diff --git a/src/MacVim/MacVim.h b/src/MacVim/MacVim.h index bad6f8e09a..515ebe8355 100644 --- a/src/MacVim/MacVim.h +++ b/src/MacVim/MacVim.h @@ -43,6 +43,9 @@ #ifndef MAC_OS_X_VERSION_10_14 # define MAC_OS_X_VERSION_10_14 101400 #endif +#ifndef MAC_OS_X_VERSION_10_15 +# define MAC_OS_X_VERSION_10_15 101500 +#endif #ifndef MAC_OS_VERSION_11_0 # define MAC_OS_VERSION_11_0 110000 #endif @@ -55,6 +58,9 @@ #ifndef MAC_OS_VERSION_14_0 # define MAC_OS_VERSION_14_0 140000 #endif +#ifndef MAC_OS_VERSION_15_0 +# define MAC_OS_VERSION_15_0 150000 +#endif #ifndef NSAppKitVersionNumber10_10 # define NSAppKitVersionNumber10_10 1343 @@ -62,6 +68,9 @@ #ifndef NSAppKitVersionNumber10_10_Max # define NSAppKitVersionNumber10_10_Max 1349 #endif +#ifndef NSAppKitVersionNumber10_11 +# define NSAppKitVersionNumber10_11 1404 +#endif #ifndef NSAppKitVersionNumber10_12 # define NSAppKitVersionNumber10_12 1504 #endif @@ -74,6 +83,9 @@ #ifndef NSAppKitVersionNumber10_14 # define NSAppKitVersionNumber10_14 1671 #endif +#ifndef NSAppKitVersionNumber10_15 +# define NSAppKitVersionNumber10_15 1894 +#endif #ifndef NSAppKitVersionNumber11_0 # define NSAppKitVersionNumber11_0 2022 #endif