GNOME Bugzilla – Bug 660761
Allow builder to specify alternate extension for modules
Last modified: 2018-02-15 14:55:41 UTC
Created attachment 198061 [details] [review] Give builder opportunity to change DLL extension There are a few places where the extension of ".dll" is hard-coded. While it is true that this is most often the right name, there are circumstances where it is useful for the person compiling GLib to be able to use something else. For example, when compiling both 32-bit and 64-bit versions to sit side by side it is useful to have 32-bit extensions have one suffix (say, .x32) and 64-bit versions to have another (say, .x64). The attached patch provides the person compiling GLib with just that flexibility, and doesn't change any defaults.
From the looks of it, this will only word if GMODULE_WIN32_EXTENSION is a 4-character string, probably starting with a dot. At the very least that restriction should be documented.
Created attachment 198104 [details] [review] Replacement patch not sentitive to string length
Created a new patch that isn't sensitive to the replacement length. No reason it has to start with a period OR be exactly 4 characters long, although in practice almost anyone wanting to use this would make sure both of those were true. But the new patch is less sensitive to people being silly.
a grep show that gio-querymodules needs the same fix... this should ideally be defined in a private header, maybe even config.h instead of duplicated everywhere. Maybe you can define both prefix and suffix on all platforms (prefix would be empty on windows) and get rid of the ifdefs in the actual code.
Heh ... in a fit of synchronicity I didn't even notice your comment about doing a prefix as well, and did it anyway. New patch attached.
Created attachment 198455 [details] [review] Deal with prefixes and suffixes, for allplatforms
I think this would best be fixed by allowing the user to specify some flags about how the module they are trying to load is named, rather than hard-coding more platform-specific prefixes/suffixes. ⇒ Bug #671212 *** This bug has been marked as a duplicate of bug 671212 ***