[pangomm/pangomm-2-46] pangommconfig.h.*: Don't dllimport on MinGW



commit 83d6667ef402a330f01430aad742c6576e66cb07
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Mar 9 16:07:31 2021 +0800

    pangommconfig.h.*: Don't dllimport on MinGW
    
    This will fix warnings when building items using pangomm with MinGW/GCC.
    
    Please see: https://gitlab.gnome.org/GNOME/gtkmm/-/issues/90

 pango/pangommconfig.h.in    | 4 +++-
 pango/pangommconfig.h.meson | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/pango/pangommconfig.h.in b/pango/pangommconfig.h.in
index c410224..f02798f 100644
--- a/pango/pangommconfig.h.in
+++ b/pango/pangommconfig.h.in
@@ -24,8 +24,10 @@
 #ifdef PANGOMM_DLL
 # if defined(PANGOMM_BUILD)
 #  define PANGOMM_API __declspec(dllexport)
-# else
+# elif !defined (__GNUC__)
 #  define PANGOMM_API __declspec(dllimport)
+# else /* don't dllimport classes/methods on GCC/MinGW */
+#  define PANGOMM_API
 # endif /* PANGOMM_BUILD - _WINDLL */
 #else
 /* Build a static library or a non-native-Windows library */
diff --git a/pango/pangommconfig.h.meson b/pango/pangommconfig.h.meson
index 562c9c9..5eb895f 100644
--- a/pango/pangommconfig.h.meson
+++ b/pango/pangommconfig.h.meson
@@ -24,8 +24,10 @@
 #ifdef PANGOMM_DLL
 # if defined(PANGOMM_BUILD)
 #  define PANGOMM_API __declspec(dllexport)
-# else
+# elif !defined (__GNUC__)
 #  define PANGOMM_API __declspec(dllimport)
+# else /* don't dllimport classes/methods on GCC/MinGW */
+#  define PANGOMM_API
 # endif /* PANGOMM_BUILD - _WINDLL */
 #else
 /* Build a static library or a non-native-Windows library */


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