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



commit 9c1a6d46e4e93fd301ed5229a2bced90f7438f8f
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 5c7932c..710d38d 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 c4dba01..58fa4d8 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]