[gdk-pixbuf] Update gdk-pixbuf-io.c for Windows



commit 453268bb76e0bf4b327e23df719f84ef7c853747
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Mar 31 00:02:59 2011 +0800

    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)

 gdk-pixbuf/gdk-pixbuf-io.c |   61 +++++++++++++++++++++++---------------------
 1 files changed, 32 insertions(+), 29 deletions(-)
---
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index 466e661..1aae318 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)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]