summaryrefslogtreecommitdiff
path: root/lib/cdefs.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-03-10 15:04:55 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-03-10 15:22:29 -0800
commitfc6d7d850bdebfed81e9212910f44edf99dd7743 (patch)
tree760bdff7508b5bcd05fccfc43c633e115689eb93 /lib/cdefs.h
parentf0d3a4d726d16b77b3fe7fb155b29ab792452a4f (diff)
downloadgnulib-fc6d7d850bdebfed81e9212910f44edf99dd7743.tar.gz
libc-config: port to DragonFlyBSD 5.9
DragonFlyBSD defines __nonnull incompatibly with glibc, so avoid the use of __nonnull in Gnulib code. Problem reported by Gavin Smith in: https://lists.gnu.org/r/bug-gnulib/2021-03/msg00066.html * lib/cdefs.h (__attribute_nonnull__): Rename from __nonnull. All uses in Gnulib changed. There should be no need to change glibc code that is not shared with Gnulib. (__nonnull): New macro, defined in terms of __attribute_nonnull__, and which can be used in glibc code that is not shared with Gnulib.
Diffstat (limited to 'lib/cdefs.h')
-rw-r--r--lib/cdefs.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/cdefs.h b/lib/cdefs.h
index 6f12c79da6..90f97412a9 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -321,15 +321,15 @@
/* The nonnull function attribute marks pointer parameters that
must not be NULL. */
-#ifndef __nonnull
+#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