[glib] gobject: Fix compilation on OS X/ppc64



commit 54e79d7dcb4c0d36ab867e1814ff26b97b4617d9
Author: Misty De Meo <mistydemeo gmail com>
Date:   Wed Sep 18 23:41:22 2013 -0700

    gobject: Fix compilation on OS X/ppc64
    
    Apple's GCC compilers cannot deal well with 64-bit pointers in
    transparent unions on ppc64, so compilation of
    _G_DEFINE_BOXED_TYPE_BEGIN was failing. Fortunately glib already
    provides a fallback for compilers that can't deal with it; this adds
    this specific case to the check.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=647145

 gobject/gtype.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gobject/gtype.h b/gobject/gtype.h
index 5dda9b0..ff57af7 100644
--- a/gobject/gtype.h
+++ b/gobject/gtype.h
@@ -1764,7 +1764,10 @@ type_name##_get_type (void) \
  */
 #define G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName, type_name, copy_func, free_func, _C_) 
_G_DEFINE_BOXED_TYPE_BEGIN (TypeName, type_name, copy_func, free_func) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
 
-#if !defined (__cplusplus) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
+/* Only use this in non-C++ on GCC >= 2.7, except for Darwin/ppc64.
+ * See https://bugzilla.gnome.org/show_bug.cgi?id=647145
+ */
+#if !defined (__cplusplus) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !(defined 
(__APPLE__) && defined (__ppc64__))
 #define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \
 GType \
 type_name##_get_type (void) \



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