Account for clangs lack of __alloc_size__

clang's emulation of gcc 4.3 is not perfect, despite its
pretending that it is.

https://bugzilla.gnome.org/show_bug.cgi?id=745821
This commit is contained in:
Matthias Clasen 2015-03-22 14:18:36 -04:00
parent 0e0b777cfb
commit 42870201f8

View File

@ -63,7 +63,8 @@
#define G_GNUC_NULL_TERMINATED #define G_GNUC_NULL_TERMINATED
#endif #endif
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) #if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
(defined(__clang__) && __has_attribute(__alloc_size__))
#define G_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) #define G_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
#define G_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y))) #define G_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
#else #else