summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2005-05-17 23:36:43 +0300
committerH.Merijn Brand <h.m.brand@xs4all.nl>2005-05-17 18:45:56 +0000
commitf22be1b8bd009cf4b53bd4bad9a8883a7dc9f572 (patch)
tree2ee4840676fc0abdea337fd792d1f7dbe3a7c30c /perl.h
parent802a55ac9fc25e44a7cec31c7f4ed63e323d6f4a (diff)
downloadperl-f22be1b8bd009cf4b53bd4bad9a8883a7dc9f572.tar.gz
more about __attribute__
Message-ID: <428A2BAB.9020306@gmail.com> p4raw-id: //depot/perl@24495
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/perl.h b/perl.h
index 05d81f9fe1..cb64a6e0ee 100644
--- a/perl.h
+++ b/perl.h
@@ -2558,17 +2558,39 @@ typedef pthread_key_t perl_key;
# endif
#endif
+/* See http://www.ohse.de/uwe/articles/gcc-attributes.html, but
+ * contrary to the information warn_unused_result seems not to be in
+ * gcc 3.3.5, at least. --jhi */
+
#if __GNUC__ >= 3
# define __attribute__malloc__ __attribute__((malloc))
+#endif
+#if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || __GNUC__ > 3
# define __attribute__nonnull__(a) __attribute__((nonnull(a)))
+#endif
+#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 || __GNUC__ > 2
# define __attribute__noreturn__ __attribute__((noreturn))
+#endif
+#if __GNUC__ >= 3
# define __attribute__pure__ __attribute__((pure))
+#endif
+#if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3
# define __attribute__warn_unused_result__ __attribute__((warn_unused_result))
-#else
+#endif
+
+#ifndef __attribute__malloc__
# define __attribute__malloc__
+#endif
+#ifndef __attribute__nonnull__
# define __attribute__nonnull__(a)
+#endif
+#ifndef __attribute__noreturn__
# define __attribute__noreturn__
+#endif
+#ifndef __attribute__pure__
# define __attribute__pure__
+#endif
+#ifndef __attribute__warn_unused_result__
# define __attribute__warn_unused_result__
#endif