From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Charles A. Roelli" Newsgroups: gmane.emacs.devel Subject: Re: NS runtime feature detection Date: Mon, 24 Jul 2017 21:02:57 +0200 Message-ID: <508a4930-feab-588b-0ab9-f55a10ea85ec@aurox.ch> References: <20170713202234.GA23777@breton.holly.idiocy.org> <20170716230109.GA54914@breton.holly.idiocy.org> <1ce59431-ff6b-dc89-31a6-8fc5bd4e3926@aurox.ch> <20170718221629.GA55506@breton.holly.idiocy.org> <20170722112230.GA58424@breton.holly.idiocy.org> <20170723121701.GA3730@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1500923009 4149 195.159.176.226 (24 Jul 2017 19:03:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Jul 2017 19:03:29 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cc: Paul Michael Reilly , Jean-Christophe Helary , Emacs-Devel devel To: Alan Third , Anders Lindgren Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 24 21:03:25 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZidS-0000T4-Ob for ged-emacs-devel@m.gmane.org; Mon, 24 Jul 2017 21:03:18 +0200 Original-Received: from localhost ([::1]:56517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZidY-0004Pi-5f for ged-emacs-devel@m.gmane.org; Mon, 24 Jul 2017 15:03:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZidK-0004Mz-1a for emacs-devel@gnu.org; Mon, 24 Jul 2017 15:03:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZidG-00074L-4X for emacs-devel@gnu.org; Mon, 24 Jul 2017 15:03:10 -0400 Original-Received: from [2a03:2040:2:1b::1] (port=59400 helo=sinyavsky.aurox.ch) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dZidF-000738-Oa for emacs-devel@gnu.org; Mon, 24 Jul 2017 15:03:06 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 3E6AF224C9 for ; Mon, 24 Jul 2017 18:57:38 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= content-transfer-encoding:content-type:content-type:in-reply-to :mime-version:user-agent:date:date:message-id:from:from :references:to:subject:subject; s=dkim; t=1500922657; x= 1501786658; bh=rew8tCjIjp0QqL9BUJ7sKVDIPXrWmLxdKDhFJyHvWqc=; b=J +/WhjK6jolHZf7Xks0FtXnCD/HoeQH3IaFiyTYKl9ppL9JubRDZxInxcqb5ixC+3 q6Ihhzpja39tJp79r8/q2YmcCQhBcjgfx1Ax3ZNSVd38f5zjsH9JzyUVB6yoOmpi DelElvMHX4S6mF/yAf+u7CwZiQMrlzVdvYmmecGDe0= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id aVrn_JHUPRY7 for ; Mon, 24 Jul 2017 18:57:37 +0000 (UTC) Original-Received: from [192.168.1.120] (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 8A1FE224A1; Mon, 24 Jul 2017 18:57:35 +0000 (UTC) In-Reply-To: <20170723121701.GA3730@breton.holly.idiocy.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a03:2040:2:1b::1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216994 Archived-At: Thanks for taking the initiative with this. Maybe it's time to open a bu= g? When I try to compile with the patch applied, with this block: @@ -7349,7 +7365,11 @@ - (void)windowDidEnterFullScreen /* provided for=20 direct calls */ { BOOL tbar_visible =3D FRAME_EXTERNAL_TOOL_BAR (emacsframe) ? YES = : NO; #ifdef NS_IMPL_COCOA -#if MAC_OS_X_VERSION_MAX_ALLOWED >=3D MAC_OS_X_VERSION_10_7 +#if MAC_OS_X_VERSION_MAX_ALLOWED <=3D MAC_OS_X_VERSION_10_6 + /* These two values are only defined in 10.7 and above. */ + int NSApplicationPresentationFullScreen =3D (1 << 10); + int NSApplicationPresentationAutoHideToolbar =3D (1 << 11); +#endif unsigned val =3D (unsigned)[NSApp presentationOptions]; while building with: ./configure --with-ns --enable-macos-runtime-feature-detection && make I got these errors: nsterm.m: In function =91-[EmacsView windowDidEnterFullScreen]=92: nsterm.m:7395: error: =91NSApplicationPresentationFullScreen=92 undeclare= d=20 (first use in this function) nsterm.m:7395: error: (Each undeclared identifier is reported only once nsterm.m:7395: error: for each function it appears in.) nsterm.m:7396: error: =91NSApplicationPresentationAutoHideToolbar=92=20 undeclared (first use in this function) (line numbers are off due to an intervening commit) I'm confused why the macro call you wrote doesn't prevent this. But when I change it to #if MAC_OS_X_VERSION_MIN_ALLOWED <=3D MAC_OS_X_VERSION_10_6, then it compiles. This min/max stuff always confuses me... On 23/07/2017 14:17, Alan Third wrote: > On Sat, Jul 22, 2017 at 12:22:30PM +0100, Alan Third wrote: >> Or perhaps we provide a flag that enables a universal binary build >> that doesn=92t bother about hiding the warnings? > Attached is a first attempt at this in nsterm.m. I think I=92ve got > everything, but there may be some new variables and things defined > that I=92ve missed which will throw up errors in older macOS versions. > > It seems =91universal binary=92 means something specific, so I went wit= h a > different name. > > Use: > > ./configure --with-ns --enable-macos-runtime-feature-detection > > It will give a lot of deprecation and unknown method warnings, but > hopefully that=92s all. > > If you build normally there should be no (new) warnings or errors.