[gtkmm/use-dllexport-3-24: 2/9] gdk/gdkmmconfig.h.in: Add GDKMM_API



commit c8f644d2da7fe51a63cf128feb4b3180a9132422
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 db0076f0..785fe39d 100644
--- a/gdk/gdkmmconfig.h.in
+++ b/gdk/gdkmmconfig.h.in
@@ -15,4 +15,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]