]> Pileus Git - ~andy/gtk/commitdiff
Mark the version variables for proper import and export from Windows DLLs.
authorTor Lillqvist <tml@iki.fi>
Tue, 6 Jul 2004 22:27:44 +0000 (22:27 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Tue, 6 Jul 2004 22:27:44 +0000 (22:27 +0000)
2004-07-06  Tor Lillqvist  <tml@iki.fi>

* gdk-pixbuf-features.h.in: Mark the version variables for proper
import and export from Windows DLLs. Thanks to Laurent Sansonetti
for reporting the problem.

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-features.h.in
gdk-pixbuf/gdk-pixbuf.c

index 8716efd959f008791fc579b7afc5da3600c2cbf2..2090c025937d038a540e3d89f3e423c90172d766 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-06  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk-pixbuf-features.h.in: Mark the version variables for proper
+       import and export from Windows DLLs. Thanks to Laurent Sansonetti
+       for reporting the problem.
+
 Sat Jul  3 00:41:44 2004  Matthias Clasen  <maclas@gmx.de>
 
        * pixops/pixops.c (bilinear_box_make_weights): Correct the
index 0681f4961002619029a91b6bcf93ddb4cbf46559..2d7299f317f5e084f125ba3687d0e36d2bf71ed3 100644 (file)
@@ -6,7 +6,32 @@
 #define GDK_PIXBUF_MICRO (@GDK_PIXBUF_MICRO@)
 #define GDK_PIXBUF_VERSION "@GDK_PIXBUF_VERSION@"
 
-extern const guint gdk_pixbuf_major_version, gdk_pixbuf_minor_version, gdk_pixbuf_micro_version;
-extern const char *gdk_pixbuf_version;
+/* We prefix variable declarations so they can
+ * properly get exported/imported from Windows DLLs.
+ */
+#ifndef GDK_PIXBUF_VAR
+#  ifdef G_PLATFORM_WIN32
+#    ifdef GDK_PIXBUF_STATIC_COMPILATION
+#      define GDK_PIXBUF_VAR extern
+#    else /* !GDK_PIXBUF_STATIC_COMPILATION */
+#      ifdef GDK_PIXBUF_COMPILATION
+#        ifdef DLL_EXPORT
+#          define GDK_PIXBUF_VAR __declspec(dllexport)
+#        else /* !DLL_EXPORT */
+#          define GDK_PIXBUF_VAR extern
+#        endif /* !DLL_EXPORT */
+#      else /* !GDK_PIXBUF_COMPILATION */
+#        define GDK_PIXBUF_VAR extern __declspec(dllimport)
+#      endif /* !GDK_PIXBUF_COMPILATION */
+#    endif /* !GDK_PIXBUF_STATIC_COMPILATION */
+#  else /* !G_PLATFORM_WIN32 */
+#    ifndef GDK_PIXBUF_COMPILATION
+#      define GDK_PIXBUF_VAR extern
+#    endif /* !GDK_PIXBUF_COMPILATION */
+#  endif /* !G_PLATFORM_WIN32 */
+#endif /* GDK_PIXBUF_VAR */
+
+GDK_PIXBUF_VAR const guint gdk_pixbuf_major_version, gdk_pixbuf_minor_version, gdk_pixbuf_micro_version;
+GDK_PIXBUF_VAR const char *gdk_pixbuf_version;
 
 #endif
index 9428fa650d7c1fa31e3f14714e07109f895d681d..7a43464ac703a6be1ad2ad0e3ff16b2873057223 100644 (file)
@@ -27,6 +27,7 @@
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
+#define GDK_PIXBUF_COMPILATION
 #include "gdk-pixbuf.h"
 #include "gdk-pixbuf-private.h"
 
@@ -518,11 +519,11 @@ gdk_pixbuf_get_rowstride (const GdkPixbuf *pixbuf)
 \f
 
 /* General initialization hooks */
-const guint gdk_pixbuf_major_version = GDK_PIXBUF_MAJOR;
-const guint gdk_pixbuf_minor_version = GDK_PIXBUF_MINOR;
-const guint gdk_pixbuf_micro_version = GDK_PIXBUF_MICRO;
+GDK_PIXBUF_VAR const guint gdk_pixbuf_major_version = GDK_PIXBUF_MAJOR;
+GDK_PIXBUF_VAR const guint gdk_pixbuf_minor_version = GDK_PIXBUF_MINOR;
+GDK_PIXBUF_VAR const guint gdk_pixbuf_micro_version = GDK_PIXBUF_MICRO;
 
-const char *gdk_pixbuf_version = GDK_PIXBUF_VERSION;
+GDK_PIXBUF_VAR const char *gdk_pixbuf_version = GDK_PIXBUF_VERSION;
 
 /* Error quark */
 GQuark