summaryrefslogtreecommitdiff
path: root/glib/gtypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'glib/gtypes.h')
-rw-r--r--glib/gtypes.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/glib/gtypes.h b/glib/gtypes.h
index 487ecdc77..29c4de81c 100644
--- a/glib/gtypes.h
+++ b/glib/gtypes.h
@@ -327,15 +327,25 @@ G_END_DECLS
/* We prefix variable declarations so they can
* properly get exported in windows dlls.
*/
-#ifdef G_OS_WIN32
-# ifdef GLIB_COMPILATION
-# define GLIB_VAR __declspec(dllexport)
-# else /* !GLIB_COMPILATION */
-# define GLIB_VAR extern __declspec(dllimport)
-# endif /* !GLIB_COMPILATION */
-#else /* !G_OS_WIN32 */
-# define GLIB_VAR extern
-#endif /* !G_OS_WIN32 */
+#ifndef GLIB_VAR
+# ifdef G_PLATFORM_WIN32
+# ifdef GLIB_STATIC_COMPILATION
+# define GLIB_VAR extern
+# else /* !GLIB_STATIC_COMPILATION */
+# ifdef GLIB_COMPILATION
+# ifdef DLL_EXPORT
+# define GLIB_VAR __declspec(dllexport)
+# else /* !DLL_EXPORT */
+# define GLIB_VAR extern
+# endif /* !DLL_EXPORT */
+# else /* !GLIB_COMPILATION */
+# define GLIB_VAR extern __declspec(dllimport)
+# endif /* !GLIB_COMPILATION */
+# endif /* !GLIB_STATIC_COMPILATION */
+# else /* !G_PLATFORM_WIN32 */
+# define GLIB_VAR extern
+# endif /* !G_PLATFORM_WIN32 */
+#endif /* GLIB_VAR */
#endif /* __G_TYPES_H__ */