unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: "Mattias Engdegård" <mattias.engdegard@gmail.com>, 72440@debbugs.gnu.org
Subject: bug#72440: 31.0.50; MacOS: TUINSRemoteViewController log message
Date: Mon, 5 Aug 2024 20:16:32 +0100	[thread overview]
Message-ID: <ZrElEKAbrsD5HXnB@idiocy.org> (raw)
In-Reply-To: <m24j7yygd0.fsf@pro2.fritz.box>

On Mon, Aug 05, 2024 at 08:27:55PM +0200, Gerd Möllmann wrote:
> Mattias Engdegård <mattias.engdegard@gmail.com> writes:
> 
> > 5 aug. 2024 kl. 17.27 skrev Gerd Möllmann <gerd.moellmann@gmail.com>:
> >
> >> Can you please check with what I just committed?
> >
> > Thank you but that doesn't make a difference -- it's a static, not dynamic, warning.
> > Instead we could put it inside
> >
> > #if MAC_OS_X_VERSION_MAX_ALLOWED >= 140000
> > ..
> > #endif
> >
> > which works here but I may be confusing the version macros.
> >
> > More to the point, is the [self setClipsToBounds: YES] line actually
> > required with older OS versions? If so, maybe it's just a matter of
> > declaring the property somehow since it's supposed to exist even if
> > the declaration was only made public in v14, but not sure if that is
> > even possible.
> 
> I also don't know what's the right thing to do is here. One could use
> the #ifdef as you showed, but then an Emacs compiled on 13.x won't do
> what it should when run on 14.x. (I gather that it would otherwise run
> fine.)

IIRC apps built on an older version of macOS generally run as though
they are on that version of macOS even when on a newer version.

> A runtime check with NSAppKitVersionNumber would work, if one copies the
> float values for the version from NSApplication.h, and compares with
> that. One has to copy the version number if one compiles on older
> versions where the constant is not defined (can be either a define or a
> const double in 14.5 here).
> 
> What a mess. Hopefully Alan has some advice.

The correct thing to do is only set this when compiling on v14 or
above, so the #ifdef is the right way to go.

FWIW, we have never guaranteed an executable compiled on one version
of macOS will work on any other version. At one time I put a fair bit
of effort into trying to get that working and it just turned into a
nightmare of #if's and runtime checks all over the place and made
maintenance far too hard.

Apple's approach would be that you *always* compile against the latest
version, and only support three versions back, or whatever, and that
way you can easily insert run-time checks as the API will always be
available at compile time, even if it's not there at runtime.

Emacs packagers generally build against multiple versions of macOS and
ship a bundle of multiple executables that are selected by a script at
runtime.

(Another approach, that I'd not recommend, would be to just put the
code in with no check whatsoever. A non-existent method will always
return nil at runtime, and just return a warning at compile time. This
means people compiling on older versions just have to live with
compiler warnings, but otherwise nothing should break.)
-- 
Alan Third





  reply	other threads:[~2024-08-05 19:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-03 10:33 bug#72440: 31.0.50; MacOS: TUINSRemoteViewController log message Gerd Möllmann
2024-08-05  7:42 ` Gerd Möllmann
2024-08-05 15:14 ` Mattias Engdegård
2024-08-05 15:27   ` Gerd Möllmann
2024-08-05 15:49     ` Mattias Engdegård
2024-08-05 18:27       ` Gerd Möllmann
2024-08-05 19:16         ` Alan Third [this message]
2024-08-05 19:38           ` Mattias Engdegård
2024-08-05 19:46             ` Mattias Engdegård
2024-08-05 20:01               ` Alan Third
2024-08-06  3:29                 ` Gerd Möllmann
2024-08-05 20:12             ` Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZrElEKAbrsD5HXnB@idiocy.org \
    --to=alan@idiocy.org \
    --cc=72440@debbugs.gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=mattias.engdegard@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).