GNOME Bugzilla – Bug 173098
glib/gutils.h at least broken for c++
Last modified: 2005-07-20 08:37:45 UTC
using glib/gutils.h with g++ gives the following compile time error (and I can't make any sense of the code either;) : g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../intl -I../../lib -Id:/gtk/include/gtk-2.0 -Id:/gtk/lib/gtk-2.0/include -Id:/gtk/include/atk-1.0 -Id:/gtk/include/pango-1.0 -Id:/gtk/include/glib-2.0 -Id:/gtk/lib/glib-2.0/include -Id:/gtk/include/libxml2 -Id:/gtk/include/libart-2.0 -I/gtk/include -g -O2 -MT wmf.lo -MD -MP -MF .deps/wmf.Tpo -c wmf.cpp -DDLL_EXPORT -DPIC -o .libs/wmf.o In file included from d:/gtk/include/glib-2.0/glib/gstring.h:32, from d:/gtk/include/glib-2.0/glib/giochannel.h:32, from d:/gtk/include/glib-2.0/glib.h:45, from wmf.cpp:27: d:/gtk/include/glib-2.0/glib/gutils.h: In function `const gchar* const* g_win32_get_system_data_dirs()': d:/gtk/include/glib-2.0/glib/gutils.h:134: error: invalid conversion from `const gchar* const*(*)()' to `const void*' d:/gtk/include/glib-2.0/glib/gutils.h:134: error: initializing argument 1 of `const gchar* const* g_win32_get_system_data_dirs_for_module(const void*)' make[3]: *** [wmf.lo] Error 1
Does adding a (gconstpointer) cast in front of the &g_win32_get_system_data_dirs help?
Tor, whats up with this ? Why is there a non-inlined function body in gutils.h on win32 ? That doesn't make much sense to me...
The idea is that when code in some DLL calls g_get_system_data_dirs(), it will automagically call g_win32_get_system_data_dirs_for_module(), passing it a pointer to code in the DLL itself.
But I guess the function should be made G_INLINE_FUNC.
Should be fixed now: 2005-07-20 Tor Lillqvist <tml@novell.com> * glib/gutils.h (g_win32_get_system_data_dirs): Make this an inline function. Define it only if G_CAN_INLINE and not C++. (#173098)