[glib] macros: add dummy __has_builtin()



commit 89bda59170b662d65f91d36220492cc890dafa0d
Author: Allison Ryan Lortie <desrt desrt ca>
Date:   Wed Oct 28 11:14:11 2015 +0000

    macros: add dummy __has_builtin()
    
    Add a dummy definition for Clang's __has_builtin() macro.  This will
    allow us to use __has_builtin() unconditionally, in the same way as we
    already do for __has_feature().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=503096

 glib/gmacros.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/glib/gmacros.h b/glib/gmacros.h
index a7a250e..e944c8b 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -68,6 +68,10 @@
 #define __has_feature(x) 0
 #endif
 
+#ifndef __has_builtin
+#define __has_builtin(x) 0
+#endif
+
 #if     (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
         (defined(__clang__) && __has_feature(__alloc_size__))
 #define G_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]