diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2005-05-17 23:36:43 +0300 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2005-05-17 18:45:56 +0000 |
commit | f22be1b8bd009cf4b53bd4bad9a8883a7dc9f572 (patch) | |
tree | 2ee4840676fc0abdea337fd792d1f7dbe3a7c30c /perl.h | |
parent | 802a55ac9fc25e44a7cec31c7f4ed63e323d6f4a (diff) | |
download | perl-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.h | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -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 |