[gtkmm/use-dllexport: 54/62] gtk/gtkmmconfig.h.[meson|in]: Re-organize GTKMM_API definitions



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

    gtk/gtkmmconfig.h.[meson|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    | 17 +++++++----------
 gtk/gtkmmconfig.h.meson | 17 +++++++----------
 2 files changed, 14 insertions(+), 20 deletions(-)
---
diff --git a/gtk/gtkmmconfig.h.in b/gtk/gtkmmconfig.h.in
index c9faf251..9a7b8d6a 100644
--- a/gtk/gtkmmconfig.h.in
+++ b/gtk/gtkmmconfig.h.in
@@ -21,22 +21,19 @@
 /* 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 */
+#if !defined(__CYGWIN__) && defined(_WIN32) && !defined(GTKMM_STATIC_LIB)
 # 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 (GDKMM_BUILD) || 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 */
 # define GTKMM_API
 #endif /* GTKMM_DLL */
 
diff --git a/gtk/gtkmmconfig.h.meson b/gtk/gtkmmconfig.h.meson
index bbacb747..36a9317d 100644
--- a/gtk/gtkmmconfig.h.meson
+++ b/gtk/gtkmmconfig.h.meson
@@ -21,22 +21,19 @@
 /* Define when building gtkmm as a static library. */
 #mesondefine 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 */
+#if !defined(__CYGWIN__) && defined(_WIN32) && !defined(GTKMM_STATIC_LIB)
 # 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 (GDKMM_BUILD) || 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 */
 # define GTKMM_API
 #endif /* GTKMM_DLL */
 


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