After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 173098 - glib/gutils.h at least broken for c++
glib/gutils.h at least broken for c++
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: win32
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2005-04-08 18:23 UTC by Hans Breuer
Modified: 2005-07-20 08:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Hans Breuer 2005-04-08 18:23:19 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
Comment 1 Tor Lillqvist 2005-04-09 00:45:48 UTC
Does adding a (gconstpointer) cast in front of the &g_win32_get_system_data_dirs
help?
Comment 2 Matthias Clasen 2005-07-19 15:33:18 UTC
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...
Comment 3 Tor Lillqvist 2005-07-19 15:48:00 UTC
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.
Comment 4 Tor Lillqvist 2005-07-19 15:55:40 UTC
But I guess the function should be made G_INLINE_FUNC. 
Comment 5 Tor Lillqvist 2005-07-20 08:37:45 UTC
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)