]> Pileus Git - ~andy/gtk/commitdiff
Fix and simplify definition of GDK_PIXBUF_VAR:
authorMichael Natterer <mitch@imendio.com>
Tue, 27 May 2008 12:05:14 +0000 (12:05 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Tue, 27 May 2008 12:05:14 +0000 (12:05 +0000)
2008-05-27  Michael Natterer  <mitch@imendio.com>

Fix and simplify definition of GDK_PIXBUF_VAR:

* Makefile.am: add -DGDK_PIXBUF_COMPILATION to INCLUDES.

* gdk-pixbuf.c: don't #define it here. Remove GDK_PIXBUF_VAR from
the definition of the version variables.

* gdk-pixbuf-features.h.in: in the !G_PLATFORM_WIN32 case, always
define GDK_PIXBUF_VAR to "extern". Remove redundant #ifndef
GDK_PIXBUF_VAR around the whole block, the header itself already
has include guards.

svn path=/trunk/; revision=20188

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

index 580353ea64e001e0334fc9495545ac888010fc3d..be06ecf75ee8ec48dc90064d141a53be38bc073b 100644 (file)
@@ -1,3 +1,17 @@
+2008-05-27  Michael Natterer  <mitch@imendio.com>
+
+       Fix and simplify definition of GDK_PIXBUF_VAR:
+
+       * Makefile.am: add -DGDK_PIXBUF_COMPILATION to INCLUDES.
+
+       * gdk-pixbuf.c: don't #define it here. Remove GDK_PIXBUF_VAR from
+       the definition of the version variables.
+
+       * gdk-pixbuf-features.h.in: in the !G_PLATFORM_WIN32 case, always
+       define GDK_PIXBUF_VAR to "extern". Remove redundant #ifndef
+       GDK_PIXBUF_VAR around the whole block, the header itself already
+       has include guards.
+
 2008-05-12  Tor Lillqvist  <tml@novell.com>
 
        Bug 532558 - Cannot build dll when using separate builddir
index bead87b88b9ea2c7461f198f9ff4194c107219a7..b320f2996df87752f947f5eef1e98c097f56e478 100644 (file)
@@ -500,6 +500,7 @@ builtin_objs = @INCLUDED_LOADER_OBJ@
 DEPS = libgdk_pixbuf-$(GTK_API_VERSION).la
 INCLUDES = \
        -DG_LOG_DOMAIN=\"GdkPixbuf\"            \
+       -DGDK_PIXBUF_COMPILATION                \
        -I$(top_srcdir) -I$(top_builddir)       \
        -I$(top_srcdir)/gdk-pixbuf              \
        -I$(top_builddir)/gdk-pixbuf            \
index 87eab582a87e8ff064bac2c46cec4fa9df5d556d..e1e28f95e856ac05a479600f235ef30f030eb466 100644 (file)
@@ -9,33 +9,27 @@
 /* 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
-#    else
-#      define 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 /* !G_PLATFORM_WIN32 */
-#endif /* GDK_PIXBUF_VAR */
+#  endif /* !GDK_PIXBUF_STATIC_COMPILATION */
+#else /* !G_PLATFORM_WIN32 */
+#  define GDK_PIXBUF_VAR extern
+#endif /* !G_PLATFORM_WIN32 */
 
 GDK_PIXBUF_VAR const guint gdk_pixbuf_major_version;
 GDK_PIXBUF_VAR const guint gdk_pixbuf_minor_version;
 GDK_PIXBUF_VAR const guint gdk_pixbuf_micro_version;
 GDK_PIXBUF_VAR const char *gdk_pixbuf_version;
 
-#endif
+#endif /* GDK_PIXBUF_FEATURES_H */
index f440baf3ac32187296881d2d76a58a2022c18f2c..6aaffcd977a52df703a8dfbdd3e0e3c58f8e9a50 100644 (file)
@@ -27,7 +27,6 @@
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
-#define GDK_PIXBUF_COMPILATION
 #include "gdk-pixbuf.h"
 #include "gdk-pixbuf-private.h"
 /* Include the marshallers */
@@ -508,11 +507,11 @@ gdk_pixbuf_get_rowstride (const GdkPixbuf *pixbuf)
 \f
 
 /* General initialization hooks */
-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 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 char *gdk_pixbuf_version = GDK_PIXBUF_VERSION;
+const char *gdk_pixbuf_version = GDK_PIXBUF_VERSION;
 
 /* Error quark */
 GQuark