unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ryan Schmidt <gnulib@ryandesign.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: "Dan Ports" <dports@macports.org>,
	"Jeffrey Walton" <noloader@gmail.com>,
	"Werner LEMBERG" <wl@gnu.org>, "Gnulib bugs" <bug-gnulib@gnu.org>,
	"Mattias Engdegård" <mattiase@acm.org>,
	Emacs-Devel <emacs-devel@gnu.org>,
	"Filipp Gunbin" <fgunbin@fastmail.fm>
Subject: Re: Emacs 28.1 doesn't compile on Mac OS 10.7.5
Date: Sun, 17 Apr 2022 09:33:31 -0500	[thread overview]
Message-ID: <73BFD071-DF6F-4310-974B-CD51DE1CDC29@ryandesign.com> (raw)
In-Reply-To: <79eee929-3cbe-8a5c-8ef2-06517572d83a@cs.ucla.edu>

On Apr 17, 2022, at 02:54, Paul Eggert wrote:

> On 4/16/22 20:28, Jeffrey Walton wrote:
>> maybe you should define a couple of macros
>> like GNULIB_LLVM_CLANG_VER and GNULIB_APPLE_CLANG_VER
> 
> I hope we don't need to do that. This is software archaeology (Mac OS X 10.7.5 is so old that neither the Subject: line nor my patch got its name right, and nobody mentioned the mistake :-) and these macros would clutter the code for little benefit. Most Clang-specific code nowadays shouldn't use Clang version numbers; it should use __has_builtin etc.

I agree you should detect features if you can. If you can't, and you need to look at the compiler version, you need to first establish whether you're using Apple Clang or open source clang, since the two use different version numbering schemes. If __clang__ is defined and __apple_build_version__ is defined, you're using Apple Clang and you could inspect that constant directly or you could look at __clang_major__, __clang_minor__, and/or __clang_patchlevel__ interpreted as Apple Clang version numbers. If __clang__ is defined and __apple_build_version__ is not defined, you're using open source clang and can look at the __clang_*__ defines interpreted as open source clang version numbers.


Some sample output from my system:

$ clang -dM -E - < /dev/null | egrep '__(clang|apple)'
#define __apple_build_version__ 4250028
#define __clang__ 1
#define __clang_major__ 4
#define __clang_minor__ 2
#define __clang_patchlevel__ 0
#define __clang_version__ "4.2 (clang-425.0.28)"

$ clang -v
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

$ xcodebuild -version
Xcode 4.6.3
Build version 4H1503

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.7.5
BuildVersion:	11G63






  parent reply	other threads:[~2022-04-17 14:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 11:55 Emacs 28.1 doesn't compile on Mac OS 10.7.5 Werner LEMBERG
2022-04-15 13:16 ` Mattias Engdegård
2022-04-15 13:48   ` Mattias Engdegård
2022-04-15 15:23     ` Werner LEMBERG
2022-04-15 15:54       ` Eli Zaretskii
2022-04-15 16:48         ` Werner LEMBERG
2022-04-15 16:22       ` Mattias Engdegård
2022-04-15 16:41         ` Mattias Engdegård
2022-04-15 16:51         ` Werner LEMBERG
2022-04-15 17:13           ` Mattias Engdegård
2022-04-15 17:40             ` Werner LEMBERG
2022-04-15 18:34               ` Mattias Engdegård
2022-04-15 19:47                 ` Eli Zaretskii
2022-04-16  5:18                 ` Werner LEMBERG
2022-04-16  7:35                   ` Werner LEMBERG
2022-04-16 10:30                     ` Mattias Engdegård
2022-04-16 15:25                       ` Werner LEMBERG
2022-04-17  2:21         ` Paul Eggert
2022-04-17  3:28           ` Jeffrey Walton
2022-04-17  7:54             ` Paul Eggert
2022-04-17 11:09               ` Werner LEMBERG
2022-04-17 14:33               ` Ryan Schmidt [this message]
2022-04-17 14:51                 ` Jeffrey Walton
2022-04-17  9:13           ` Mattias Engdegård
2022-04-17  9:32             ` Po Lu
2022-04-17  9:38               ` Mattias Engdegård
2022-04-17 11:33             ` Eli Zaretskii
2022-04-17 12:27               ` Mattias Engdegård
2022-04-17 17:54             ` Paul Eggert

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=73BFD071-DF6F-4310-974B-CD51DE1CDC29@ryandesign.com \
    --to=gnulib@ryandesign.com \
    --cc=bug-gnulib@gnu.org \
    --cc=dports@macports.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=fgunbin@fastmail.fm \
    --cc=mattiase@acm.org \
    --cc=noloader@gmail.com \
    --cc=wl@gnu.org \
    /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).