From fd96fb4c0627ce1ccffd9b504ac6ad6cc4aa9962 Mon Sep 17 00:00:00 2001 From: ichizok Date: Wed, 28 Mar 2018 23:00:06 +0900 Subject: [PATCH 1/2] Fix the way to check OS version --- src/MacVim/gui_macvim.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/MacVim/gui_macvim.m b/src/MacVim/gui_macvim.m index 3b573329ad..27e8392a29 100644 --- a/src/MacVim/gui_macvim.m +++ b/src/MacVim/gui_macvim.m @@ -285,12 +285,14 @@ gui_mch_init(void) [[MMBackend sharedInstance] addToMRU:filenames]; } -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10 + if ([[NSProcessInfo processInfo] + respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)]) { - NSOperatingSystemVersion version = {10, 13, 0}; + NSOperatingSystemVersion version = {10, 13, 0}; - is_macos_high_sierra_or_later = - [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:version]; + is_macos_high_sierra_or_later = [[NSProcessInfo processInfo] + isOperatingSystemAtLeastVersion:version]; } #endif From dd4c394b890fd27b5d825451b7f270e835c62c90 Mon Sep 17 00:00:00 2001 From: ichizok Date: Wed, 28 Mar 2018 23:09:13 +0900 Subject: [PATCH 2/2] Fix code formatting --- src/MacVim/gui_macvim.m | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/MacVim/gui_macvim.m b/src/MacVim/gui_macvim.m index 27e8392a29..4719f1cc76 100644 --- a/src/MacVim/gui_macvim.m +++ b/src/MacVim/gui_macvim.m @@ -1900,7 +1900,8 @@ gui_macvim_wait_for_startup() [backend waitForConnectionAcknowledgement]; } -void gui_macvim_get_window_layout(int *count, int *layout) + void +gui_macvim_get_window_layout(int *count, int *layout) { if (!(count && layout)) return; @@ -1914,12 +1915,14 @@ void gui_macvim_get_window_layout(int *count, int *layout) } } -void *gui_macvim_new_autoreleasepool() + void * +gui_macvim_new_autoreleasepool() { return (void *)[[NSAutoreleasePool alloc] init]; } -void gui_macvim_release_autoreleasepool(void *pool) + void +gui_macvim_release_autoreleasepool(void *pool) { [(id)pool release]; } @@ -2245,7 +2248,8 @@ is_valid_macaction(char_u *action) return isValid; } -static int specialKeyToNSKey(int key) + static int +specialKeyToNSKey(int key) { if (!IS_SPECIAL(key)) return key; @@ -2310,7 +2314,8 @@ static int specialKeyToNSKey(int key) return 0; } -static int vimModMaskToEventModifierFlags(int mods) + static int +vimModMaskToEventModifierFlags(int mods) { int flags = 0;