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 777501 - W32: g_get_system_data_dirs() works differently for C++ applications
W32: g_get_system_data_dirs() works differently for C++ applications
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: win32
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-19 17:45 UTC by LRN
Modified: 2018-05-24 19:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
W32: Make _g_win32_get_system_data_dirs() inline available in C++ (1.11 KB, patch)
2017-01-19 18:56 UTC, LRN
none Details | Review

Description LRN 2017-01-19 17:45:53 UTC
tml committed f0a0fe7a44917f32267b375f700ce6c972e3382d back in 2005 and made _g_win32_get_system_data_dirs() an inline that exists only in C, not in C++.

Thus for C++ programs it will return, eventually, directories relative to the currently-running executable, while for C programs it will return directories relative to the caller module (whether it's an executable or a library).

Normally it's just weird (and probably resulted in a number of unexpected issues for gtkmm and other C++ programs). With the patch from bug 766358 applied, this actually crashes, because g_get_system_data_dirs() (which normally shouldn't be called outside of glib itself) returns NULL.
Comment 1 Ignacio Casal Quinteiro (nacho) 2017-01-19 18:41:25 UTC
That is just weird, I would say go ahead and make it available for c++ as well.
Comment 2 LRN 2017-01-19 18:56:05 UTC
Created attachment 343833 [details] [review]
W32: Make _g_win32_get_system_data_dirs() inline available in C++

This way g_get_system_data_dirs() works the same way in C and C++.

I've tried to compile enchant with this patch applied to gutils.h, and didn't see any compile-time warnings about it. Enchant also stopped crashing, and i was able to finally run gedit too.
Comment 3 Fan, Chun-wei 2017-01-20 00:52:25 UTC
Hi LRN,

I would just say go ahead with this as well.  For the other bug you linked to, I remember desrt had some other opinions about XDG_DATA_DIRS--if the maintainers would be ok with that, I think you could go ahead with that.

My take on this.

With blessings, and cheers!
Comment 4 Allison Karlitskaya (desrt) 2017-01-24 14:50:24 UTC
I have no opinion on this function's visibility to C++ or C in Windows, other than to say that the current behaviour seems very strange, and I agree that it should be changed.
Comment 5 GNOME Infrastructure Team 2018-05-24 19:22:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1240.