]> Savannah Git Hosting - gnulib.git/commitdiff
Port __has_attribute to Apple’s Clang renumbering
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 25 Feb 2022 23:30:42 +0000 (15:30 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 25 Feb 2022 23:31:05 +0000 (15:31 -0800)
Problem reported by Kirill A. Korinsky in:
https://lists.gnu.org/r/bug-gnulib/2022-02/msg00034.html
* config/srclist.txt: Comment out sys/cdefs.h for now.
* lib/cdefs.h (__glibc_has_attribute):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
Port to Apple’s renumbering of Clang versions.

ChangeLog
config/srclist.txt
lib/cdefs.h
m4/gnulib-common.m4

index 49a1e6a168074a2eae2db451d9ea32df76a47e66..0b8525e92641bc55343709ca6ee5277cc725cc32 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2022-02-25  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Port __has_attribute to Apple’s Clang renumbering
+       Problem reported by Kirill A. Korinsky in:
+       https://lists.gnu.org/r/bug-gnulib/2022-02/msg00034.html
+       * config/srclist.txt: Comment out sys/cdefs.h for now.
+       * lib/cdefs.h (__glibc_has_attribute):
+       * m4/gnulib-common.m4 (gl_COMMON_BODY):
+       Port to Apple’s renumbering of Clang versions.
+
        nanosleep: simplify by using pselect
        GNU Emacs avoids Gnulib’s ‘select’ module and uses only pselect,
        which it implements in a special way on MS-DOS.
index dc69587e9996406765ce5d0bc7638c6b220e7911..d89cd30ed9a71e1679269253dc67398a3a6d0bb0 100644 (file)
@@ -64,7 +64,7 @@ $LIBCSRC malloc/scratch_buffer_grow.c lib/malloc
 $LIBCSRC malloc/scratch_buffer_grow_preserve.c lib/malloc
 $LIBCSRC malloc/scratch_buffer_set_array_size.c        lib/malloc
 #$LIBCSRC include/intprops.h             lib
-$LIBCSRC misc/sys/cdefs.h              lib
+#$LIBCSRC misc/sys/cdefs.h             lib
 #$LIBCSRC posix/regcomp.c              lib
 $LIBCSRC posix/regex.c                 lib
 $LIBCSRC posix/regex.h                 lib
index 44d3826bca9f6f84f862acf1035408a587fac71d..cb2514504f19008a270dd76b4082c2d2388ced92 100644 (file)
@@ -41,7 +41,9 @@
    Similarly for __has_builtin, etc.  */
 #if (defined __has_attribute \
      && (!defined __clang_minor__ \
-         || 3 < __clang_major__ + (5 <= __clang_minor__)))
+         || (defined __apple_build_version__ \
+             ? 6000000 <= __apple_build_version__ \
+             : 3 < __clang_major__ + (5 <= __clang_minor__))))
 # define __glibc_has_attribute(attr) __has_attribute (attr)
 #else
 # define __glibc_has_attribute(attr) 0
index dbc407961481e9e854eb24d971a700f9415091d4..c5ced04f181844195b6f0c37063618d9219f889e 100644 (file)
@@ -69,7 +69,9 @@ AC_DEFUN([gl_COMMON_BODY], [
 [/* Attributes.  */
 #if (defined __has_attribute \
      && (!defined __clang_minor__ \
-         || 3 < __clang_major__ + (5 <= __clang_minor__)))
+         || (defined __apple_build_version__ \
+             ? 6000000 <= __apple_build_version__ \
+             : 3 < __clang_major__ + (5 <= __clang_minor__))))
 # define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
 #else
 # define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr