* [PATCH] libc-config: port to Apple’s Clang variant
@ 2020-02-04 3:02 Paul Eggert
0 siblings, 0 replies; only message in thread
From: Paul Eggert @ 2020-02-04 3:02 UTC (permalink / raw)
To: bug-gnulib; +Cc: Paul Eggert
* lib/libc-config.h (__glibc_clang_prereq):
Port to Apple’s Clang variant, which uses a different
numbering scheme for __clang_major__.
---
ChangeLog | 7 +++++++
lib/libc-config.h | 13 +++++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2a86791a8..5afe01563 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-02-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ libc-config: port to Apple’s Clang variant
+ * lib/libc-config.h (__glibc_clang_prereq):
+ Port to Apple’s Clang variant, which uses a different
+ numbering scheme for __clang_major__.
+
2020-02-02 Bruno Haible <bruno@clisp.org>
Document the new modules list-c++, set-c++, oset-c++, map-c++, omap-c++.
diff --git a/lib/libc-config.h b/lib/libc-config.h
index 889e01638..4ae8665bb 100644
--- a/lib/libc-config.h
+++ b/lib/libc-config.h
@@ -55,8 +55,17 @@
#ifndef __glibc_clang_prereq
# if defined __clang_major__ && defined __clang_minor__
-# define __glibc_clang_prereq(maj, min) \
- ((maj) < __clang_major__ + ((min) <= __clang_minor__))
+# ifdef __apple_build_version__
+/* Apple for some reason renumbers __clang_major__ and __clang_minor__.
+ Gnulib code uses only __glibc_clang_prereq (3, 5); map it to
+ 6000000 <= __apple_build_version__. Support for other calls to
+ __glibc_clang_prereq can be added here as needed. */
+# define __glibc_clang_prereq(maj, min) \
+ ((maj) == 3 && (min) == 5 ? 6000000 <= __apple_build_version__ : 0)
+# else
+# define __glibc_clang_prereq(maj, min) \
+ ((maj) < __clang_major__ + ((min) <= __clang_minor__))
+# endif
# else
# define __glibc_clang_prereq(maj, min) 0
# endif
--
2.24.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-02-04 3:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 3:02 [PATCH] libc-config: port to Apple’s Clang variant Paul Eggert
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).