git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] git-compat-util: fix NO_OPENSSL on current macOS
Date: Thu, 18 Apr 2024 13:21:59 -0400	[thread overview]
Message-ID: <CAPig+cQr3xcnuoyf58YWbXCekhhRgN+M9=WsN4_PYcK7BydDUg@mail.gmail.com> (raw)
In-Reply-To: <3188f4e2-9744-40b1-8f05-0896b8679d25@web.de>

On Sun, Apr 14, 2024 at 12:47 PM René Scharfe <l.s.r@web.de> wrote:
> b195aa00c1 (git-compat-util: suppress unavoidable Apple-specific
> deprecation warnings, 2014-12-16) started to define
> __AVAILABILITY_MACROS_USES_AVAILABILITY in git-compat-util.h.  On
> current versions it is already defined (e.g. on macOS 14.4.1).  Undefine
> it before redefining it to avoid a compilation error.
>
> Signed-off-by: René Scharfe <l.s.r@web.de>
> ---
> On my system I can remove the whole ifdef __APPLE__ section, as the OS
> doesn't include the deprecated OpenSSL anymore.  I get a current version
> via Homebrew, which doesn't throw any deprecation warnings, of course.
>
> Not sure if this is the right fix, as the no longer needed section still
> undefines __AVAILABILITY_MACROS_USES_AVAILABILITY at the end, which we
> may want to keep instead.  But compilation succeeds and tests pass, so
> perhaps it's fine.

I think I added the final `#undef
__AVAILABILITY_MACROS_USES_AVAILABILITY` in b195aa00c1
(git-compat-util: suppress unavoidable Apple-specific deprecation
warnings, 2014-12-16) just for completeness; since I #define'd it, I
also #undef'd it to ensure a clean state or the C preprocessor.

However, taking this new situation into account, where
__AVAILABILITY_MACROS_USES_AVAILABILITY is now defined by default, it
_probably_ would be more correct to drop that final #undef.

Having said that, though, it doesn't seem that it is likely to matter
one way or the other as the project stands presently, especially since
you report that building and testing succeeds. Moreover, the only
other place in the project where we seem to care about the Apple
version-compatibility macros is in
compat/fsmonitor/fsm-listen-darwin.c, but even that isn't a problem
because it consults a version-compatibility macro before #include'ing
git-compat-util:

    #ifndef AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
    #define kFSEventStreamEventFlagItemCloned 0x00400000
    #endif
    #include "git-compat-util.h"

So, this patch can't possibly have any sort of negative interaction
with that code even if __AVAILABILITY_MACROS_USES_AVAILABILITY somehow
impacted AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER.


      reply	other threads:[~2024-04-18 17:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-14 16:47 [PATCH] git-compat-util: fix NO_OPENSSL on current macOS René Scharfe
2024-04-18 17:21 ` Eric Sunshine [this message]

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: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CAPig+cQr3xcnuoyf58YWbXCekhhRgN+M9=WsN4_PYcK7BydDUg@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    /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://80x24.org/mirrors/git.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).