[gtkmm/use-dllexport-3-24: 8/15] gtk/gtkmmconfig.h.in: Re-organize GTKMM_API definitions



commit a4026ce66dabf5ba98cce7a003bb0884eddb0766
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Apr 10 17:39:47 2020 +0800

    gtk/gtkmmconfig.h.in: Re-organize GTKMM_API definitions
    
    This way, we can update the public headers and use this macro to export
    symbols without using gendef if the classes and methods are marked
    adequately.

 gtk/gtkmmconfig.h.in | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkmmconfig.h.in b/gtk/gtkmmconfig.h.in
index c9faf251..9fff6c9f 100644
--- a/gtk/gtkmmconfig.h.in
+++ b/gtk/gtkmmconfig.h.in
@@ -21,22 +21,20 @@
 /* Define when building gtkmm as a static library. */
 #undef GTKMM_STATIC_LIB
 
-/* Enable DLL-specific stuff only when not building a static library. */
-#if (!defined(GTKMM_STATIC_LIB) && !defined(__CYGWIN__) && defined(_WIN32))
+/* Enable DLL-specific stuff only when not building a static library  nor using gendef. */
+#if !defined(__CYGWIN__) && defined(_WIN32) && \
+    !defined(GTKMM_STATIC_LIB) && !defined(GTKMM_USE_GENDEF)
 # define GTKMM_DLL 1
 #endif
 
 #ifdef GTKMM_DLL
-# if defined(GTKMM_BUILD) && defined(_WINDLL)
-   /* Do not dllexport as it is handled by gendef on MSVC. */
-#  define GTKMM_API
-# elif !defined(GTKMM_BUILD)
-#  define GTKMM_API __declspec(dllimport)
+# if defined(GTKMM_BUILD)
+#  define GTKMM_API __declspec(dllexport)
 # else
-   /* Build a static library. */
-#  define GTKMM_API
-# endif /* GTKMM_BUILD - _WINDLL */
+#  define GTKMM_API __declspec(dllimport)
+# endif
 #else
+/* Build a static library or a non-native Windows library or gendef is used. */
 # define GTKMM_API
 #endif /* GTKMM_DLL */
 


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