summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2011-03-31 00:02:59 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2011-03-31 00:02:59 +0800
commit453268bb76e0bf4b327e23df719f84ef7c853747 (patch)
tree9e96c42becd8d664705b85e63bbc74261a6365eb
parent116386c04fdfe2eb565b2f721432f87869490ccb (diff)
downloadgdk-pixbuf-453268bb76e0bf4b327e23df719f84ef7c853747.tar.gz
Update gdk-pixbuf-io.c for Windows
Move _gdk_pixbuf_win32_get_toplevel (void) outside of USE_GMODULE as changes for 98d373ed51df92a1c784a91af91d880bf741208e would break compilation when image loaders are built in the main DLL, such as in MSVC or MinGW builds using --disable-modules etc. (i.e. USE_GMODULE is not defined)
-rw-r--r--gdk-pixbuf/gdk-pixbuf-io.c61
1 files changed, 32 insertions, 29 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index 466e66152..1aae318fb 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.c
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
@@ -229,6 +229,38 @@ get_file_formats (void)
return file_formats;
}
+#ifdef G_OS_WIN32
+
+/* DllMain function needed to tuck away the gdk-pixbuf DLL handle */
+
+static HMODULE gdk_pixbuf_dll;
+
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved)
+{
+ switch (fdwReason) {
+ case DLL_PROCESS_ATTACH:
+ gdk_pixbuf_dll = (HMODULE) hinstDLL;
+ break;
+ }
+
+ return TRUE;
+}
+
+char *
+_gdk_pixbuf_win32_get_toplevel (void)
+{
+ static char *toplevel = NULL;
+
+ if (toplevel == NULL)
+ toplevel = g_win32_get_package_installation_directory_of_module (gdk_pixbuf_dll);
+
+ return toplevel;
+}
+#endif
+
#ifdef USE_GMODULE
@@ -313,35 +345,6 @@ skip_space (const char **pos)
#ifdef G_OS_WIN32
-/* DllMain function needed to tuck away the gdk-pixbuf DLL handle */
-
-static HMODULE gdk_pixbuf_dll;
-
-BOOL WINAPI
-DllMain (HINSTANCE hinstDLL,
- DWORD fdwReason,
- LPVOID lpvReserved)
-{
- switch (fdwReason) {
- case DLL_PROCESS_ATTACH:
- gdk_pixbuf_dll = (HMODULE) hinstDLL;
- break;
- }
-
- return TRUE;
-}
-
-char *
-_gdk_pixbuf_win32_get_toplevel (void)
-{
- static char *toplevel = NULL;
-
- if (toplevel == NULL)
- toplevel = g_win32_get_package_installation_directory_of_module (gdk_pixbuf_dll);
-
- return toplevel;
-}
-
static char *
get_libdir (void)
{