From: Tor Lillqvist Date: Sun, 11 Oct 2009 21:18:48 +0000 (+0300) Subject: Construct the gio module directory pathname at run-time on Windows X-Git-Tag: 2.23.0~86 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=443674faaa0c6c79492732fd56360faeca06e9ab;p=platform%2Fupstream%2Fglib.git Construct the gio module directory pathname at run-time on Windows --- diff --git a/gio/giomodule.c b/gio/giomodule.c index ec5b650..93405e5 100644 --- a/gio/giomodule.c +++ b/gio/giomodule.c @@ -297,6 +297,39 @@ extern GType _g_win32_volume_monitor_get_type (void); extern GType g_win32_directory_monitor_get_type (void); extern GType _g_winhttp_vfs_get_type (void); +#ifdef G_PLATFORM_WIN32 + +#include + +static HMODULE gio_dll = NULL; + +#ifdef DLL_EXPORT + +BOOL WINAPI +DllMain (HINSTANCE hinstDLL, + DWORD fdwReason, + LPVOID lpvReserved) +{ + if (fdwReason == DLL_PROCESS_ATTACH) + gio_dll = hinstDLL; + + return TRUE; +} + +#endif + +#undef GIO_MODULE_DIR + +/* GIO_MODULE_DIR is used only in code called just once, + * so no problem leaking this + */ +#define GIO_MODULE_DIR \ + g_build_filename (g_win32_get_package_installation_directory_of_module (gio_dll), \ + "lib/gio/modules", \ + NULL) + +#endif + void _g_io_modules_ensure_extension_points_registered (void) {