From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Emacs 28 on OSX: emacsclient.c:1415: warning: implicit declaration of function 'openat' Date: Mon, 18 Apr 2022 10:53:39 +0800 Message-ID: <87pmlfksp8.fsf@yahoo.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10595"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: emacs-devel@gnu.org, Alan Third , Mattias =?utf-8?Q?Engdeg=C3=A5rd?= , Paul Eggert To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 18 04:54:32 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ngHX6-0002YS-6G for ged-emacs-devel@m.gmane-mx.org; Mon, 18 Apr 2022 04:54:32 +0200 Original-Received: from localhost ([::1]:45180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ngHX4-0004DW-OH for ged-emacs-devel@m.gmane-mx.org; Sun, 17 Apr 2022 22:54:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngHWV-0003YU-Go for emacs-devel@gnu.org; Sun, 17 Apr 2022 22:53:55 -0400 Original-Received: from sonic310-25.consmr.mail.ne1.yahoo.com ([66.163.186.206]:39929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ngHWT-0007kr-Ct for emacs-devel@gnu.org; Sun, 17 Apr 2022 22:53:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650250429; bh=96rKPo43MsuWY7fI2LRGN3o/fr6pOoaLYyX+ooQhfxk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=KqLPMvqc7t7xmr1WLF4kd9GIe7em74mMQZlZgkKLqx2M2nf4ZT1qHUHOdvF9+C2BawTbGiEJPDnUR4Z1uN0oYn6qmnnjhEi9qoNTdsNeByL3uBF5ITH4OSgjLtMf/gAU0RS61zU9/AD9MWNcwGlGpciVI6pl/mfGQRdVuXexNkNXJkuXjbePIBvpweHhkJD7xAEcGCiqB72UMEFNKfAvoqQEC5fWiOBWYw+ibNxZHbW2Qs9UxpRmiS1sfNoBqj/dd0J4Vz81HFDqifLAzzJ+jB31jMhBoVnkuOe90oqVLNM2YZNbBw2iyZG7H+Cv/hlXcRK90Soiazb8+07K7redXQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650250429; bh=sM4lZt8PNVlR45b3lbLCS4nJkEq4thBeiKbGKm1E9gY=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=DmOpCClfVxsP1cBnSKwMrHN+lra4UTQs3ZKFuU77AQ4KYlqwfUnerK7QyqDymjPQvK7MnZ1SFoWAl6lofztQmNbTBPShqSe8odqy47BhcCMWhr7/dWKYQqlV/qVuFasXhrOm1kyP60flcc5Jy4T2HTb0WsdeQryG5iHwTt1bjUYWwgtOKJKs/2ErkG1wstfrKAt07CbfXPq1+/axBRqzbPm4jQPi5kwHKZjhLt+JQx8u5uf4+WuvzwHoX1vVt/B+1GYO4rzHmLljfa3oXY43F6xE20+7F+CAbWx8u2MMEOOLE93IAZzcLVBzyp7/iSnUxS4Fn3qbBydJEmaT+zHRRQ== X-YMail-OSG: mAEPxfIVM1kbSxksBe2HEOowjkm7ODYOfdcrFskejM_huRoWln3P_8_SiYsLoBH hJqghhaTjOq9ddHb6ocn48M3LsB9uLhQxY_P776SZ9syjE2OD4QFAPKdzJ54sRTayAPfdhK9hPZc 1HwolkKXKtKv6gFbFJswPkWkQJds5sDCtfkmp8QxQxB5YgCltj28B5.F6cbgk1B3Z15pHzb5Iu.9 4jmWKkOd1_TeBgtXUZmZpEk75LQBFxWgDehot26mTFu6EL_7YHMVMxxtXp32CH9jsUm3BXXr4UC6 9w4m7uh4rAho5PVgai.NkQzm27o5iie5M.tuTootJLLIugUMIKO1icmMOPziqciy9M0mm6_fhK07 4TNShcY.2B1FXQN.MHwfcMp5TYVrdI2Ff0ZgXAdDd1Mg78uQUAzj36t2qAo8zcMpVxcOUu8iM0ey Mf4u7iij6GXmZowYZrbU34btTLxyVoYeSc8k9DcEDIr9yOl8_RgHt372hU65UvxQ3zcJQmiH.1fK 4u4XUhfhy2oaIypL0b8MPEd3DlkIvoeeFx_kCX5zYzoAT_GDjO_FqHD84OJxzR6TAXIuL3TH0vdk UBBOmJu268NCXBP8vTiWzfxocM6N1I7GQ8fxbMGDscbAGhAonWeg2kdN1E341D3wk3fLRFarY2i1 PFd_TN4F2dds3Ygthp.0zxWgueHzPOhiyvNMHRCnQ1WGqvC3MS8ZwtXw3DpLSW9S0XcwWNXctIAh 5hun0OsX0L.hv0.MGLtWazRXvQT.daGF1I64l4ObNnwUAI_lgmhL8ngik.jos9f6jTTz5rCIhj5Y t5KJT29Sa4YTbFxPEQEYnUKKtgau2Mn3q9j.SRe3lf X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Mon, 18 Apr 2022 02:53:49 +0000 Original-Received: by hermes--canary-production-sg3-cfddc4f9d-lhc7t (VZM Hermes SMTP Server) with ESMTPA ID b257f8ebca52bf6b2c1667b498f9f9fe; Mon, 18 Apr 2022 02:53:44 +0000 (UTC) In-Reply-To: (Keith David Bershatsky's message of "Sun, 17 Apr 2022 19:24:31 -0700") X-Mailer: WebService/1.1.20048 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.186.206; envelope-from=luangruo@yahoo.com; helo=sonic310-25.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288588 Archived-At: Keith David Bershatsky writes: > I applied the patch from Po Lu to the master branch and have the following output when building on OSX 10.6.8: > > CC nsterm.o > In file included from nsterm.m:46: > lisp.h:2156: warning: declaration does not declare anything > nsterm.m: In function 'ns_frame_scale_factor': > nsterm.m:807: warning: 'NSWindow' may not respond to '-backingScaleFactor' > nsterm.m:807: warning: (Messages without a matching method signature > nsterm.m:807: warning: will be assumed to return 'id' and accept > nsterm.m:807: warning: '...' as arguments.) > nsterm.m:807: error: incompatible types in return > nsterm.m: In function '-[EmacsWindow initWithEmacsFrame:fullscreen:screen:]': > nsterm.m:8405: warning: 'EmacsWindow' may not respond to '-setTabbingMode:' > nsterm.m: In function '-[EmacsWindow setParentChildRelationships]': > nsterm.m:8478: warning: 'EmacsWindow' may not respond to '-setAccessibilitySubrole:' > nsterm.m:8480: warning: 'EmacsWindow' may not respond to '-setAccessibilitySubrole:' > make[1]: *** [nsterm.o] Error 1 > make: *** [src] Error 2 > ~/Desktop/emacs $ > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > >> Date: [04-17-2022 18:39:41] <18 Apr 2022 09:39:41 +0800> >> From: Po Lu >> * * * This should fix the setTabbingMode warning, but what's the value of MAC_OS_X_VERSION_MAX_ALLOWED on your system? I guess it should be `1060', not higher, not lower. diff --git a/src/nsterm.m b/src/nsterm.m index 550f29212e..fd6e67a8cb 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -751,7 +751,19 @@ Free a pool and temporary objects it refers to (callable from C) EmacsView *parentView = FRAME_NS_VIEW (FRAME_PARENT_FRAME (f)); parentRect = [parentView convertRect:[parentView frame] toView:nil]; - parentRect = [[parentView window] convertRectToScreen:parentRect]; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + if ([[parentView window] respondsToSelector: @selector(convertRectToScreen:)]) +#endif + parentRect = [[parentView window] convertRectToScreen: parentRect]; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + else +#endif +#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 */ +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 \ + || defined (NS_IMPL_GNUSTEP) + parentRect.origin = [[parentView window] convertBaseToScreen: parentRect.origin]; +#endif } else parentRect = [[[NSScreen screens] objectAtIndex:0] frame]; @@ -789,7 +801,14 @@ Free a pool and temporary objects it refers to (callable from C) ns_frame_scale_factor (struct frame *f) { #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > 1060 - return [[FRAME_NS_VIEW (f) window] backingScaleFactor]; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + if ([[FRAME_NS_VIEW (f) window] respondsToSelector: @selector(convertRectToScreen:)]) +#endif + return [[FRAME_NS_VIEW (f) window] backingScaleFactor]; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + else + return [[FRAME_NS_VIEW (f) window] userSpaceScaleFactor]; +#endif #else return [[FRAME_NS_VIEW (f) window] userSpaceScaleFactor]; #endif @@ -6869,7 +6888,7 @@ - (void)otherMouseDragged: (NSEvent *)e [self mouseMoved: e]; } -#ifdef NS_IMPL_COCOA +#if defined NS_IMPL_COCOA && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - (void) magnifyWithEvent: (NSEvent *) event { NSPoint pt = [self convertPoint: [event locationInWindow] fromView: nil]; @@ -6886,11 +6905,18 @@ - (void) magnifyWithEvent: (NSEvent *) event if ([event phase] == NSEventPhaseBegan) { - last_scale = 1.0 + [event magnification]; - emacs_event->arg = list4 (make_float (0.0), - make_float (0.0), - make_float (last_scale), - make_float (0.0)); +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + if ([event respondsToSelector: @selector(magnification)]) + { +#endif + last_scale = 1.0 + [event magnification]; + emacs_event->arg = list4 (make_float (0.0), + make_float (0.0), + make_float (last_scale), + make_float (0.0)); +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + } +#endif } else /* Report a tiny change so that Lisp code doesn't think this @@ -8381,7 +8407,7 @@ - (instancetype) initWithEmacsFrame:(struct frame *)f /* macOS Sierra automatically enables tabbed windows. We can't allow this to be enabled until it's available on a Free system. Currently it only happens by accident and is buggy anyway. */ -#ifdef NS_IMPL_COCOA +#if defined NS_IMPL_COCOA && MAC_OS_X_VERSION_MAX_ALLOWED >= 101200 if ([self respondsToSelector:@selector(setTabbingMode:)]) [self setTabbingMode:NSWindowTabbingModeDisallowed]; #endif @@ -8451,14 +8477,16 @@ - (void)setParentChildRelationships behaviors early otherwise child windows may not go fullscreen as expected later. */ +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 #if MAC_OS_X_VERSION_MIN_REQUIRED < 101000 - if ([child respondsToSelector:@selector(setAccessibilitySubrole:)]) + if ([self respondsToSelector:@selector(setAccessibilitySubrole:)]) #endif /* Set the accessibility subroles. */ if (parentFrame) [self setAccessibilitySubrole:NSAccessibilityFloatingWindowSubrole]; else [self setAccessibilitySubrole:NSAccessibilityStandardWindowSubrole]; +#endif #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 [ourView updateCollectionBehavior]; @@ -8484,7 +8512,7 @@ - (void)setParentChildRelationships #ifdef NS_IMPL_COCOA #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 - if ([ourView respondsToSelector:@selector (toggleFullScreen)] + if ([ourView respondsToSelector:@selector (toggleFullScreen)]) #endif /* If we are the descendent of a fullscreen window and we have no new parent, go fullscreen. */ @@ -8509,11 +8537,11 @@ - (void)setParentChildRelationships #ifdef NS_IMPL_COCOA #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 - if ([ourView respondsToSelector:@selector (toggleFullScreen)] + if ([ourView respondsToSelector:@selector (toggleFullScreen)]) #endif - /* Child frames must not be fullscreen. */ - if ([ourView fsIsNative] && [ourView isFullscreen]) - [ourView toggleFullScreen:self]; + /* Child frames must not be fullscreen. */ + if ([ourView fsIsNative] && [ourView isFullscreen]) + [ourView toggleFullScreen:self]; #endif [parentWindow addChildWindow:self