Annotate the exported version variables
authorEmmanuele Bassi <ebassi@linux.intel.com>
Wed, 29 Feb 2012 14:43:01 +0000 (14:43 +0000)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Wed, 29 Feb 2012 15:20:57 +0000 (15:20 +0000)
When using MSVC we need to annotate the variables that are going to be
exported.

clutter/clutter-version.h.in

index befd040..fcddbd7 100644 (file)
@@ -214,6 +214,21 @@ G_BEGIN_DECLS
          (CLUTTER_MAJOR_VERSION == (major) && CLUTTER_MINOR_VERSION > (minor)) || \
          (CLUTTER_MAJOR_VERSION == (major) && CLUTTER_MINOR_VERSION == (minor) && CLUTTER_MICRO_VERSION >= (micro)))
 
+/* annotation for exported variables
+ *
+ * XXX: this has to be defined here because clutter-macro.h imports this
+ * header file.
+ */
+#ifdef _MSC_VER
+# ifdef CLUTTER_COMPILATION
+#  define CLUTTER_VAR __declspec(dllexport)
+# else
+#  define CLUTTER_VAR extern __declspec(dllimport)
+# endif
+#else
+# define CLUTTER_VAR extern
+#endif
+
 /**
  * clutter_major_version:
  *
@@ -226,7 +241,7 @@ G_BEGIN_DECLS
  *
  * Since: 1.2
  */
-extern const guint clutter_major_version;
+CLUTTER_VAR const guint clutter_major_version;
 
 /**
  * clutter_minor_version:
@@ -240,7 +255,7 @@ extern const guint clutter_major_version;
  *
  * Since: 1.2
  */
-extern const guint clutter_minor_version;
+CLUTTER_VAR const guint clutter_minor_version;
 
 /**
  * clutter_micro_version:
@@ -254,7 +269,7 @@ extern const guint clutter_minor_version;
  *
  * Since: 1.2
  */
-extern const guint clutter_micro_version;
+CLUTTER_VAR const guint clutter_micro_version;
 
 gboolean clutter_check_version (guint major,
                                 guint minor,