[gtkmm/use-dllexport-3-24-meson: 4/16] gdk/gdkmmconfig.h.in: Add GDKMM_API



commit 35ec6a32f9e47abfdb890d24627555d700bf541b
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Apr 10 17:37:55 2020 +0800

    gdk/gdkmmconfig.h.in: Add GDKMM_API
    
    This enables us to use this macros later in public headers so that we
    can export symbols from the DLLs using compiler directives, instead of
    gendef, if we marked classes and APIs/methods sufficiently.

 gdk/gdkmmconfig.h.in | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/gdk/gdkmmconfig.h.in b/gdk/gdkmmconfig.h.in
index fae72ef6..b98f283d 100644
--- a/gdk/gdkmmconfig.h.in
+++ b/gdk/gdkmmconfig.h.in
@@ -18,4 +18,21 @@
 /* Minor version number of gdkmm. */
 #undef GDKMM_MINOR_VERSION
 
+/* Enable DLL-specific stuff only when not building a static library nor using gendef. */
+#if !defined(__CYGWIN__) && defined(_WIN32) && \
+    !defined(GDKMM_STATIC_LIB) && !defined(GDKMM_USE_GENDEF)
+# define GDKMM_DLL 1
+#endif
+
+#ifdef GDKMM_DLL
+# ifdef GDKMM_BUILD
+#  define GDKMM_API __declspec(dllexport)
+# else
+#  define GDKMM_API __declspec(dllimport)
+# endif /* GDKMM_BUILD */
+#else
+/* Build a static library or a non-native-Windows library */
+# define GDKMM_API
+#endif /* GDKMM_DLL */
+
 #endif /* !_GDKMM_CONFIG_H */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]