mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-10 11:14:05 +02:00
Fix the build
The world would be a better place if gcc had __has_feature(), too.
This commit is contained in:
@@ -63,8 +63,13 @@
|
|||||||
#define G_GNUC_NULL_TERMINATED
|
#define G_GNUC_NULL_TERMINATED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Clang feature detection: http://clang.llvm.org/docs/LanguageExtensions.html */
|
||||||
|
#ifndef __has_feature
|
||||||
|
#define __has_feature(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
|
#if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
|
||||||
(defined(__clang__) && __has_attribute(__alloc_size__))
|
(defined(__clang__) && __has_feature(__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
|
||||||
@@ -159,11 +164,6 @@
|
|||||||
#endif /* !__GNUC__ */
|
#endif /* !__GNUC__ */
|
||||||
#endif /* !G_DISABLE_DEPRECATED */
|
#endif /* !G_DISABLE_DEPRECATED */
|
||||||
|
|
||||||
/* Clang feature detection: http://clang.llvm.org/docs/LanguageExtensions.html */
|
|
||||||
#ifndef __has_feature
|
|
||||||
#define __has_feature(x) 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __has_feature(attribute_analyzer_noreturn)
|
#if __has_feature(attribute_analyzer_noreturn)
|
||||||
#define G_ANALYZER_ANALYZING 1
|
#define G_ANALYZER_ANALYZING 1
|
||||||
#define G_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
|
#define G_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
|
||||||
|
Reference in New Issue
Block a user