From: Paul Eggert Date: Tue, 4 Feb 2020 03:01:22 +0000 (-0800) Subject: libc-config: port to Apple’s Clang variant X-Git-Tag: v1.0~4269 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=378817e1eab8a84d11d93f7f887d05bf27f8538f;p=gnulib.git 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__. --- diff --git a/ChangeLog b/ChangeLog index 2a86791a86..5afe015631 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2020-02-03 Paul Eggert + + 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 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 889e01638d..4ae8665bb1 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