summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2011-07-13 14:47:44 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2011-07-13 14:47:44 +0800
commit15c2a9a1f71ba3a1c3570a168b674415972415dc (patch)
tree658d67c368c7f19374ca2bb05ac2caed9bec976f
parentcc294ea378be0f56e489dc87c33f0fdd4fe8fe20 (diff)
downloadatk-15c2a9a1f71ba3a1c3570a168b674415972415dc.tar.gz
Export atk_misc_intance for VS/Win32 builds
The variable atk_misc_intance needs to be explicitly decorated with the __declspec(dllexport) directive to export properly on Windows/VS DLL builds (which is the standard build). The corresponding mechanism for linking to the ATK DLL is also updated as well with extern __declspec(dllimport). This will allow GTK+ 3.1.9+ (with the a11y functions)to link correctly on Visual C++ .
-rwxr-xr-xatk/atkmisc.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/atk/atkmisc.h b/atk/atkmisc.h
index dda4568..2fad4aa 100755
--- a/atk/atkmisc.h
+++ b/atk/atkmisc.h
@@ -26,6 +26,29 @@
#include <glib-object.h>
+/* We prefix variable declarations so they can
+ * properly get exported in Windows DLLs.
+ */
+#ifndef ATK_VAR
+# ifdef G_PLATFORM_WIN32
+# ifdef ATK_STATIC_COMPILATION
+# define ATK_VAR extern
+# else /* !ATK_STATIC_COMPILATION */
+# ifdef ATK_COMPILATION
+# ifdef DLL_EXPORT
+# define ATK_VAR __declspec(dllexport)
+# else /* !DLL_EXPORT */
+# define ATK_VAR extern
+# endif /* !DLL_EXPORT */
+# else /* !ATK_COMPILATION */
+# define ATK_VAR extern __declspec(dllimport)
+# endif /* !ATK_COMPILATION */
+# endif /* !ATK_STATIC_COMPILATION */
+# else /* !G_PLATFORM_WIN32 */
+# define ATK_VAR extern
+# endif /* !G_PLATFORM_WIN32 */
+#endif /* ATK_VAR */
+
G_BEGIN_DECLS
#define ATK_TYPE_MISC (atk_misc_get_type ())
@@ -52,7 +75,7 @@ struct _AtkMisc
* a given GUI toolkit/application instance should touch this
* symbol directly.
*/
-extern AtkMisc *atk_misc_instance;
+ATK_VAR AtkMisc *atk_misc_instance;
struct _AtkMiscClass
{