emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs 28 on OSX: emacsclient.c:1415: warning: implicit declaration o


From: Po Lu
Subject: Re: Emacs 28 on OSX: emacsclient.c:1415: warning: implicit declaration of function 'openat'
Date: Tue, 19 Apr 2022 12:24:17 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Alan Third <alan@idiocy.org> writes:

> Welcome to the wonderful world of Objective C under GCC.
>
> The attached should fix this particular error.
>
> These problems will need to be fixed in the emacs-28 branch, assuming
> we're going to continue supporting macOS 10.6.
>
> FWIW, I've moved away from trying to hide warnings generated on older
> versions of macOS to try and avoid the difficult to understand #if
> constructions we've previously used throughout the code.

Thanks for clarifying, I think I understand what those constructs mean
now.

> Alan Third
>
> From f11340a5a5d234b57022908483979dfa0a9ccb99 Mon Sep 17 00:00:00 2001
> From: Alan Third <alan@idiocy.org>
> Date: Tue, 19 Apr 2022 05:05:17 +0100
> Subject: [PATCH] Fix nsmenu compilation under macOS 10.6
>
> * src/nsmenu.m ([EmacsMenu fillWithWidgetValue:]): Replace modern
> shorthand dictionary and array definitions.
> ---
>  src/nsmenu.m | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 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 */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]