diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2021-05-07 13:37:19 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2021-05-07 13:37:19 +0300 |
commit | 6f5c5d212df15586e3aab33fbea64ac665b7c3f4 (patch) | |
tree | 85f8248c8a94f88de7d9c102668e09a3a22a9ec9 /support/cdefs.h | |
parent | 0791273b7440635339a87d25e1b433747d59bc64 (diff) | |
download | egawk-6f5c5d212df15586e3aab33fbea64ac665b7c3f4.tar.gz egawk-6f5c5d212df15586e3aab33fbea64ac665b7c3f4.tar.bz2 egawk-6f5c5d212df15586e3aab33fbea64ac665b7c3f4.zip |
Really sync from GNULIB this time.
Diffstat (limited to 'support/cdefs.h')
-rw-r--r-- | support/cdefs.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/support/cdefs.h b/support/cdefs.h index 6f12c79d..b883b256 100644 --- a/support/cdefs.h +++ b/support/cdefs.h @@ -259,10 +259,12 @@ # define __attribute_const__ /* Ignore */ #endif -#if defined __STDC_VERSION__ && 201710L < __STDC_VERSION__ -# define __attribute_maybe_unused__ [[__maybe_unused__]] -#elif __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__) +#if __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__) # define __attribute_maybe_unused__ __attribute__ ((__unused__)) +/* Once the next version of the C standard comes out, we can + do something like the following here: + #elif defined __STDC_VERSION__ && 202???L <= __STDC_VERSION__ + # define __attribute_maybe_unused__ [[__maybe_unused__]] */ #else # define __attribute_maybe_unused__ /* Ignore */ #endif @@ -320,16 +322,18 @@ #endif /* The nonnull function attribute marks pointer parameters that - must not be NULL. */ -#ifndef __nonnull + must not be NULL. This has the name __nonnull in glibc, + and __attribute_nonnull__ in files shared with Gnulib to avoid + collision with a different __nonnull in DragonFlyBSD 5.9. */ +#ifndef __attribute_nonnull__ # if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__) -# define __nonnull(params) __attribute__ ((__nonnull__ params)) +# define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params)) # else -# define __nonnull(params) +# define __attribute_nonnull__(params) # endif -#elif !defined __GLIBC__ -# undef __nonnull -# define __nonnull(params) _GL_ATTRIBUTE_NONNULL (params) +#endif +#ifndef __nonnull +# define __nonnull(params) __attribute_nonnull__ (params) #endif /* If fortification mode, we warn about unused results of certain @@ -485,9 +489,9 @@ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] #endif -/* The #ifndef lets Gnulib avoid including these on non-glibc - platforms, where the includes typically do not exist. */ -#ifndef __WORDSIZE +/* Gnulib avoids including these, as they don't work on non-glibc or + older glibc platforms. */ +#ifndef __GNULIB_CDEFS # include <bits/wordsize.h> # include <bits/long-double.h> #endif |