Hi!

I was just trying to use clang++ to compile my gtkmm application and I went
to this error:

    In file included from /usr/include/gtkmm-3.0/gtkmm/drawingarea.h:28:
    In file included from /usr/include/gtkmm-3.0/gtkmm/widget.h:56:
    /usr/include/giomm-2.4/giomm/actiongroup.h:618:50: error: const_cast
from 'const GActionGroup *'
          (aka 'const _GActionGroup *') to 'GAction *' (aka '_GAction *')
is not allowed

g_variant_type_equal(g_action_get_state_type(const_cast<GAction*>(gobj())),
type_glib_va...

^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gmessages.h:340:18: note: expanded from
macro 'g_return_if_fail'
         if G_LIKELY(expr) { } else
\
                     ^
    /usr/include/glib-2.0/glib/gmacros.h:315:59: note: expanded from macro
'G_LIKELY'
    #define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1))
                                                              ^
    /usr/include/glib-2.0/glib/gmacros.h:309:8: note: expanded from macro
'_G_BOOLEAN_EXPR'
       if (expr)                                    \
           ^
    1 error generated.

So I simply tried to found how to make it work and here is a patch.
But since I'm completely new to GTK I've got no idea if it's a good
solution.

Hope it helps though.
Cheers,
Romain "Creak" Failliot
--- actiongroup.h.old	2013-11-17 21:37:58.526598408 -0500
+++ actiongroup.h	2013-11-17 21:51:47.659904737 -0500
@@ -615,7 +615,7 @@
   typedef Glib::Variant<T_Value> type_glib_variant;
 
   g_return_if_fail(
-    g_variant_type_equal(g_action_get_state_type(const_cast<GAction*>(gobj())), type_glib_variant::variant_type().gobj()));
+    g_variant_type_equal(g_action_group_get_action_state_type(const_cast<GActionGroup*>(gobj()), action_name.c_str()), type_glib_variant::variant_type().gobj()));
 
   const Glib::VariantBase variantBase = get_action_state_hint_variant(action_name);
 
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to