diff options
author | Tor Lillqvist <tml@iki.fi> | 2009-10-12 00:18:48 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2009-10-12 00:20:28 +0300 |
commit | 443674faaa0c6c79492732fd56360faeca06e9ab (patch) | |
tree | b267caa7dfaa753650a01d69fd65d07777b85f0f /gio/giomodule.c | |
parent | 2a3710872f8bfc1c95dc8044c92c9ce020adad40 (diff) | |
download | glib-443674faaa0c6c79492732fd56360faeca06e9ab.tar.gz glib-443674faaa0c6c79492732fd56360faeca06e9ab.tar.bz2 glib-443674faaa0c6c79492732fd56360faeca06e9ab.zip |
Construct the gio module directory pathname at run-time on Windows
Diffstat (limited to 'gio/giomodule.c')
-rw-r--r-- | gio/giomodule.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gio/giomodule.c b/gio/giomodule.c index ec5b65039..93405e56f 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 <windows.h> + +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) { |