diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-06-01 12:01:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:53:08 -0500 |
commit | c2781df0d5477be58c3189c6d3c17b261d7b8b89 (patch) | |
tree | 9866ad20f9b439bbdca4c6ed6191e3f084f75091 /source4/include | |
parent | aec9320dc2fdf03d5187f60749c5f3ad238bf58d (diff) | |
download | samba-c2781df0d5477be58c3189c6d3c17b261d7b8b89.tar.gz |
r23289: Provide support for GCC attributes _PURE_, _NONNULL_, _DEPRECATED_, _NORETURN_ and _WARN_UNUSED_RESULT_.
(This used to be commit 44248f662f0b609dad6a7b437948f12d661a28f7)
Diffstat (limited to 'source4/include')
-rw-r--r-- | source4/include/includes.h | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/source4/include/includes.h b/source4/include/includes.h index f1188e2aaf..1022b65545 100644 --- a/source4/include/includes.h +++ b/source4/include/includes.h @@ -62,17 +62,45 @@ #endif #endif -#ifndef NORETURN_ATTRIBUTE -#if (__GNUC__ >= 3) -#define NORETURN_ATTRIBUTE __attribute__ ((noreturn)) +#ifndef _DEPRECATED_ +#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) +#define _DEPRECATED_ __attribute__ ((deprecated)) #else -#define NORETURN_ATTRIBUTE +#define _DEPRECATED_ #endif #endif -/* mark smb_panic() as noreturn, so static analysers know that it is - used like abort */ -_PUBLIC_ void smb_panic(const char *why) NORETURN_ATTRIBUTE; +#ifndef _WARN_UNUSED_RESULT_ +#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) +#define _WARN_UNUSED_RESULT_ __attribute__ ((warn_unused_result)) +#else +#define _WARN_UNUSED_RESULT_ +#endif +#endif + +#ifndef _NORETURN_ +#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) +#define _NORETURN_ __attribute__ ((noreturn)) +#else +#define _NORETURN_ +#endif +#endif + +#ifndef _PURE_ +#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1) +#define _PURE_ __attribute__((pure)) +#else +#define _PURE_ +#endif +#endif + +#ifndef NONNULL +#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1) +#define NONNULL(param) param __attribute__((nonnull)) +#else +#define NONNULL(param) param +#endif +#endif #include "system/time.h" #include "system/wait.h" |