g_module_build_path builds incorrect paths on macOS and Windows (MSVC)
Submitted by Christophe-Marie Duquesne
In the documentation 1, it is specified that g_module_build_path is a portable way to build the file name of a module: the platform-specific prefix and suffix are added to the filename, if needed. The example given makes it clear:
"For example, calling g_module_build_path() on a Linux system with a directory of /lib and a module_name of "mylibrary" will return /lib/libmylibrary.so. On a Windows system, using \Windows as the directory it will return \Windows\mylibrary.dll."
However, this turns out to be false.
Using the windows build, the following code
returns libfoo.dll (and not foo.dll).
Attached is an archive with minimal code to illustrate the bug.