diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 8716efd959..2090c02593 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,9 @@ +2004-07-06 Tor Lillqvist + + * 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 * pixops/pixops.c (bilinear_box_make_weights): Correct the diff --git a/gdk-pixbuf/gdk-pixbuf-features.h.in b/gdk-pixbuf/gdk-pixbuf-features.h.in index 0681f49610..2d7299f317 100644 --- a/gdk-pixbuf/gdk-pixbuf-features.h.in +++ b/gdk-pixbuf/gdk-pixbuf-features.h.in @@ -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 diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c index 9428fa650d..7a43464ac7 100644 --- a/gdk-pixbuf/gdk-pixbuf.c +++ b/gdk-pixbuf/gdk-pixbuf.c @@ -27,6 +27,7 @@ #include #include #include +#define GDK_PIXBUF_COMPILATION #include "gdk-pixbuf.h" #include "gdk-pixbuf-private.h" @@ -518,11 +519,11 @@ gdk_pixbuf_get_rowstride (const GdkPixbuf *pixbuf) /* 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