Skip to content

Commit c5e68ff

Browse files
committed
Fix build error
- Add the declaration for gui_mch_menu_set_tip in proto - On prior to 10.12 comment out the declarations of touchbar methods
1 parent 8663578 commit c5e68ff

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/MacVim/MMVimController.m

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
#import "MMWindow.h"
3838

3939

40-
static NSString *MMDefaultToolbarImageName = @"Attention";
40+
static NSString * const MMDefaultToolbarImageName = @"Attention";
4141
static int MMAlertTextFieldHeight = 22;
4242

43-
static const NSString * const MMToolbarMenuName = @"ToolBar";
44-
static const NSString * const MMTouchbarMenuName = @"TouchBar";
45-
static const NSString * const MMPopUpMenuPrefix = @"PopUp";
46-
static const NSString * const MMUserPopUpMenuPrefix = @"]";
43+
static NSString * const MMToolbarMenuName = @"ToolBar";
44+
static NSString * const MMTouchbarMenuName = @"TouchBar";
45+
static NSString * const MMPopUpMenuPrefix = @"PopUp";
46+
static NSString * const MMUserPopUpMenuPrefix = @"]";
4747

4848
// NOTE: By default a message sent to the backend will be dropped if it cannot
4949
// be delivered instantly; otherwise there is a possibility that MacVim will
@@ -138,6 +138,7 @@ - (void)addToolbarItemToDictionaryWithLabel:(NSString *)title
138138
- (void)addToolbarItemWithLabel:(NSString *)label
139139
tip:(NSString *)tip icon:(NSString *)icon
140140
atIndex:(int)idx;
141+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12_2
141142
- (void)addTouchbarItemWithLabel:(NSString *)label
142143
icon:(NSString *)icon
143144
tip:(NSString *)tip
@@ -151,6 +152,7 @@ - (void)updateTouchbarItemLabel:(NSString *)label
151152
- (BOOL)touchBarItemForDescriptor:(NSArray *)desc
152153
touchBar:(MMTouchBarInfo **)touchBarPtr
153154
touchBarItem:(MMTouchBarItemInfo **)touchBarItemPtr;
155+
#endif
154156
- (void)popupMenuWithDescriptor:(NSArray *)desc
155157
atRow:(NSNumber *)row
156158
column:(NSNumber *)col;
@@ -1109,10 +1111,12 @@ - (void)alertDidEnd:(MMAlert *)alert code:(int)code context:(void *)context
11091111
pid, identifier, ex);
11101112
}
11111113
}
1114+
11121115
+ (bool) hasPopupPrefix: (NSString *) menuName
11131116
{
11141117
return [menuName hasPrefix:MMPopUpMenuPrefix] || [menuName hasPrefix:MMUserPopUpMenuPrefix];
11151118
}
1119+
11161120
- (NSMenuItem *)menuItemForDescriptor:(NSArray *)desc
11171121
{
11181122
if (!(desc && [desc count] > 0)) return nil;

src/menu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ add_menu_path(
814814
}
815815
}
816816
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) \
817-
&& (defined(FEAT_BEVAL_GUI) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MACVIM))
817+
&& (defined(FEAT_BEVAL_GUI) || defined(FEAT_GUI_GTK))
818818
// Need to update the menu tip.
819819
if (modes & MENU_TIP_MODE)
820820
gui_mch_menu_set_tip(menu);
@@ -1009,7 +1009,7 @@ remove_menu(
10091009
{
10101010
free_menu_string(menu, MENU_INDEX_TIP);
10111011
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) \
1012-
&& (defined(FEAT_BEVAL_GUI) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MACVIM))
1012+
&& (defined(FEAT_BEVAL_GUI) || defined(FEAT_GUI_GTK))
10131013
// Need to update the menu tip.
10141014
if (gui.in_use)
10151015
gui_mch_menu_set_tip(menu);

src/proto/gui_macvim.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ void gui_mch_destroy_menu(vimmenu_T *menu);
3030
void gui_mch_menu_grey(vimmenu_T *menu, int grey);
3131
void gui_mch_menu_hidden(vimmenu_T *menu, int hidden);
3232
void gui_mch_show_popupmenu(vimmenu_T *menu);
33+
void gui_mch_menu_set_tip(vimmenu_T *menu);
3334
void gui_mch_draw_menubar(void);
3435
void gui_mch_enable_menu(int flag);
3536
void gui_mch_show_toolbar(int showit);

0 commit comments

Comments
 (0)