From aba5cce5fa846094f6cbb78658d69ea0e3af7a96 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Tue, 19 Apr 2022 05:05:17 +0100 Subject: [PATCH v3] Fix nsmenu compilation under macOS 10.6 * src/nsmenu.m ([EmacsMenu fillWithWidgetValue:]): Replace modern shorthand dictionary and array definitions. * src/nsterm.h (NSTextAlignmentRight): Redefine if necessary. --- src/nsmenu.m | 10 ++++++---- src/nsterm.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nsmenu.m b/src/nsmenu.m index 81d7cd2da1..0f7d1fb98f 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -649,7 +649,8 @@ - (void)fillWithWidgetValue: (void *)wvptr work around it by using tabs to split the title into two columns. */ NSFont *menuFont = [NSFont menuFontOfSize:0]; - NSDictionary *font_attribs = @{NSFontAttributeName: menuFont}; + NSDictionary *font_attribs = [NSDictionary dictionaryWithObjectsAndKeys: + menuFont, NSFontAttributeName, nil]; CGFloat maxNameWidth = 0; CGFloat maxKeyWidth = 0; @@ -677,11 +678,12 @@ - (void)fillWithWidgetValue: (void *)wvptr NSTextTab *tab = [[[NSTextTab alloc] initWithTextAlignment: NSTextAlignmentRight location: maxWidth - options: @{}] autorelease]; + options: [NSDictionary dictionary]] autorelease]; NSMutableParagraphStyle *pstyle = [[[NSMutableParagraphStyle alloc] init] autorelease]; - [pstyle setTabStops: @[tab]]; - attributes = @{NSParagraphStyleAttributeName: pstyle}; + [pstyle setTabStops: [NSArray arrayWithObject:tab]]; + attributes = [NSDictionary dictionaryWithObjectsAndKeys: + pstyle, NSParagraphStyleAttributeName, nil]; #endif /* clear existing contents */ diff --git a/src/nsterm.h b/src/nsterm.h index 4cba5c0be8..4cb7475235 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -1290,8 +1290,8 @@ #define NSWindowStyleMaskUtilityWindow NSUtilityWindowMask #define NSAlertStyleCritical NSCriticalAlertStyle #define NSControlSizeRegular NSRegularControlSize #define NSCompositingOperationCopy NSCompositeCopy +#define NSTextAlignmentRight NSRightTextAlignment -/* And adds NSWindowStyleMask. */ #ifdef __OBJC__ typedef NSUInteger NSWindowStyleMask; #endif -- 2.35.1