diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2012-08-17 11:37:04 -0700 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2012-08-17 11:37:04 -0700 |
commit | cf9089f5ec802af897520d5bcb5376f7b6899416 (patch) | |
tree | e5bc92c07beb3594d1f43dec12a7edb6eab1d01c /glib | |
parent | f0e821fed29e2c1602dc3926937da21b208f2d6b (diff) | |
download | pkg-config-cf9089f5ec802af897520d5bcb5376f7b6899416.tar.gz |
glib: Fix static usage of glib on win32
When glib is built static, the threads and clock code are not
initialized since DllMain is never run. Instead, initialize them from
the glib constructor.
https://bugzilla.gnome.org/show_bug.cgi?id=678387
Diffstat (limited to 'glib')
-rw-r--r-- | glib/glib/glib-init.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/glib/glib/glib-init.c b/glib/glib/glib-init.c index f4edd5c..3ec89a0 100644 --- a/glib/glib/glib-init.c +++ b/glib/glib/glib-init.c @@ -225,6 +225,10 @@ glib_init (void) HMODULE glib_dll; +#endif + +#if defined (G_OS_WIN32) && !defined (GLIB_STATIC_COMPILATION) + BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, @@ -261,6 +265,10 @@ G_DEFINE_CONSTRUCTOR(glib_init_ctor) static void glib_init_ctor (void) { +#ifdef G_OS_WIN32 + g_clock_win32_init (); + g_thread_win32_init (); +#endif glib_init (); } |