diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2015-08-20 11:16:31 +0100 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2015-08-20 11:16:31 +0100 |
commit | b397eca557673240e29e60c35a2458597e95d53d (patch) | |
tree | d60aa62c855e9829c625bd08173a2bfa4ccea77a | |
parent | 39be7a8fce1c062a59590517bdab5e75a2d6028f (diff) | |
download | spice-protocol-b397eca557673240e29e60c35a2458597e95d53d.tar.gz spice-protocol-b397eca557673240e29e60c35a2458597e95d53d.tar.xz spice-protocol-b397eca557673240e29e60c35a2458597e95d53d.zip |
macros: fix compatibility with non-clang compilers
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r-- | spice/macros.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spice/macros.h b/spice/macros.h index 29cdf82..cd63528 100644 --- a/spice/macros.h +++ b/spice/macros.h @@ -47,6 +47,10 @@ #define SPICE_GNUC_NULL_TERMINATED #endif +#ifndef __has_feature +#define __has_feature(x) 0 /* Compatibility with non-clang compilers. */ +#endif + #if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \ (defined(__clang__) && __has_feature(__alloc_size__)) #define SPICE_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) |