summaryrefslogtreecommitdiffstats
path: root/sys/sys/cdefs.h
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-04-29 11:04:31 +0000
committerdim <dim@FreeBSD.org>2012-04-29 11:04:31 +0000
commit81a3e2b46db5474df3633b850805e5e981a6cbb4 (patch)
tree698e4c5df1fba3867e4ca78763a6760206f74894 /sys/sys/cdefs.h
parent6b0b09e72a82ff0e99c864ca023a9eb62f72d629 (diff)
downloadFreeBSD-src-81a3e2b46db5474df3633b850805e5e981a6cbb4.zip
FreeBSD-src-81a3e2b46db5474df3633b850805e5e981a6cbb4.tar.gz
Add a convenience macro for the returns_twice attribute, and apply it to
the prototypes of the appropriate functions (getcontext, savectx, setjmp, sigsetjmp and vfork). MFC after: 2 weeks
Diffstat (limited to 'sys/sys/cdefs.h')
-rw-r--r--sys/sys/cdefs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index 076842d..80f7b8e 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -293,6 +293,12 @@
#define __nonnull(x)
#endif
+#if __GNUC_PREREQ__(4, 1)
+#define __returns_twice __attribute__((__returns_twice__))
+#else
+#define __returns_twice
+#endif
+
/* XXX: should use `#if __STDC_VERSION__ < 199901'. */
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
#define __func__ NULL
OpenPOWER on IntegriCloud