GNOME Bugzilla – Bug 777501
W32: g_get_system_data_dirs() works differently for C++ applications
Last modified: 2018-05-24 19:22:56 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.
That is just weird, I would say go ahead and make it available for c++ as well.
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.
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!
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.
-- 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.