summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spice/macros.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/spice/macros.h b/spice/macros.h
index 180c2b7..034caf7 100644
--- a/spice/macros.h
+++ b/spice/macros.h
@@ -47,7 +47,8 @@
#define SPICE_GNUC_NULL_TERMINATED
#endif
-#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#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)))
#define SPICE_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
#else