aboutsummaryrefslogtreecommitdiffstats
path: root/support/cdefs.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2021-08-29 18:53:55 +0300
committerArnold D. Robbins <arnold@skeeve.com>2021-08-29 18:53:55 +0300
commit0e1761697d8ed24b07cf23035f5dd01d09056e3a (patch)
tree0bfa58691f81e87f3098d736bc0409c4dd5fc40c /support/cdefs.h
parent6696453c1a733436cbb9ca41c7c75eeb4e0b428a (diff)
downloadegawk-0e1761697d8ed24b07cf23035f5dd01d09056e3a.tar.gz
egawk-0e1761697d8ed24b07cf23035f5dd01d09056e3a.tar.bz2
egawk-0e1761697d8ed24b07cf23035f5dd01d09056e3a.zip
Sync support with GNULIB updates.
Diffstat (limited to 'support/cdefs.h')
-rw-r--r--support/cdefs.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/support/cdefs.h b/support/cdefs.h
index b883b256..4dac9d26 100644
--- a/support/cdefs.h
+++ b/support/cdefs.h
@@ -261,10 +261,6 @@
#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
@@ -336,6 +332,16 @@
# define __nonnull(params) __attribute_nonnull__ (params)
#endif
+/* The returns_nonnull function attribute marks the return type of the function
+ as always being non-null. */
+#ifndef __returns_nonnull
+# if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__returns_nonnull__)
+# define __returns_nonnull __attribute__ ((__returns_nonnull__))
+# else
+# define __returns_nonnull
+# endif
+#endif
+
/* If fortification mode, we warn about unused results of certain
function calls which can lead to problems. */
#if __GNUC_PREREQ (3,4) || __glibc_has_attribute (__warn_unused_result__)
@@ -598,9 +604,26 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
array according to access mode, or at least one element when
size-index is not provided:
access (access-mode, <ref-index> [, <size-index>]) */
-#define __attr_access(x) __attribute__ ((__access__ x))
+# define __attr_access(x) __attribute__ ((__access__ x))
+# if __GNUC_PREREQ (11, 0)
+# define __attr_access_none(argno) __attribute__ ((__access__ (__none__, argno)))
+# else
+# define __attr_access_none(argno)
+# endif
#else
# define __attr_access(x)
+# define __attr_access_none(argno)
+#endif
+
+#if __GNUC_PREREQ (11, 0)
+/* Designates dealloc as a function to call to deallocate objects
+ allocated by the declared function. */
+# define __attr_dealloc(dealloc, argno) \
+ __attribute__ ((__malloc__ (dealloc, argno)))
+# define __attr_dealloc_free __attr_dealloc (__builtin_free, 1)
+#else
+# define __attr_dealloc(dealloc, argno)
+# define __attr_dealloc_free
#endif
/* Specify that a function such as setjmp or vfork may return