glibc/misc/sys
Adhemerval Zanella c8ba52ab33 misc: Sync cdefs.h with gnulib
It adds __glibc_has_builtin, __glibc_has_extension, and
__attribute_maybe_unused__ alongsize with some fixes.

The differences are:

--- glibc
+++ gnulib
@@ -259,7 +259,9 @@
 # define __attribute_const__ /* Ignore */
 #endif

-#if __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__)
+#if defined __STDC_VERSION__ && 201710L < __STDC_VERSION__
+# define __attribute_maybe_unused__ [[__maybe_unused__]]
+#elif __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__)
 # define __attribute_maybe_unused__ __attribute__ ((__unused__))
 #else
 # define __attribute_maybe_unused__ /* Ignore */
@@ -485,7 +487,7 @@

 /* The #ifndef lets Gnulib avoid including these on non-glibc
    platforms, where the includes typically do not exist.  */
-#ifdef __GLIBC__
+#ifndef __WORDSIZE
 # include <bits/wordsize.h>
 # include <bits/long-double.h>
 #endif

The [[__attribute_maybe_unused__]] attribute removal __ is due Joseph
questioning gcc support with -std=c2x or -std=gnu2x [1].

The _WORDSIZE replacement by __GLIBC__ is because it does not play
well with internal cdefs.h that also uses
__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI.

Checked on x86_64-linux-gnu.

[1] https://sourceware.org/pipermail/libc-alpha/2021-January/121600.html
2021-02-09 16:57:52 -03:00
..
auxv.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
cdefs.h misc: Sync cdefs.h with gnulib 2021-02-09 16:57:52 -03:00
dir.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
file.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
ioctl.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
mman.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
param.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
queue.h [BZ #5779] 2008-03-05 05:50:39 +00:00
select.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
single_threaded.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
syslog.h Rename __LONG_DOUBLE_USES_FLOAT128 to __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 2020-04-30 08:52:08 -05:00
sysmacros.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
uio.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
xattr.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00