summaryrefslogtreecommitdiff
path: root/lib/cdefs.h
diff options
context:
space:
mode:
authorDaniel Llorens <lloda@sarc.name>2021-08-16 13:23:27 +0200
committerDaniel Llorens <lloda@sarc.name>2021-08-16 13:23:27 +0200
commitb4a80f4239b19fea4d2cc3e9d197f24b809f0624 (patch)
treeb4dc728ec96391e302df4f7c733bf592a3976ff2 /lib/cdefs.h
parent5df5555d12f1408a66a5368a918abb981edf5445 (diff)
downloadguile-b4a80f4239b19fea4d2cc3e9d197f24b809f0624.tar.gz
Update gnulib to 8f4538a53d64054ae2fc8b86c0f87c418c6176e6
Includes gnulib:0c907f7da13232908f05c415b8cec56024071906 to fix #49930 https://lists.gnu.org/archive/html/bug-guile/2021-08/msg00003.html.
Diffstat (limited to 'lib/cdefs.h')
-rw-r--r--lib/cdefs.h43
1 files changed, 35 insertions, 8 deletions
diff --git a/lib/cdefs.h b/lib/cdefs.h
index 90f97412a..4dac9d264 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -259,9 +259,7 @@
# 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__))
#else
# define __attribute_maybe_unused__ /* Ignore */
@@ -320,7 +318,9 @@
#endif
/* The nonnull function attribute marks pointer parameters that
- must not be NULL. */
+ 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 __attribute_nonnull__(params) __attribute__ ((__nonnull__ params))
@@ -332,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__)
@@ -485,9 +495,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
@@ -594,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