]> Savannah Git Hosting - gnulib.git/commitdiff
libc-config: port to Apple’s Clang variant
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 4 Feb 2020 03:01:22 +0000 (19:01 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 4 Feb 2020 03:01:49 +0000 (19:01 -0800)
* lib/libc-config.h (__glibc_clang_prereq):
Port to Apple’s Clang variant, which uses a different
numbering scheme for __clang_major__.

ChangeLog
lib/libc-config.h

index 2a86791a867ec39169bc3cd59309359ac19c1566..5afe0156312dcf96bc114a5c7b6250d4586c8ae8 100644 (file)
--- 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++.
index 889e01638df025f49b9591bcaedd78541d818493..4ae8665bb1befe2d8ba3f99c8aa725f0d44b9a34 100644 (file)
 
 #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