[gtkmm] g[d|t]kmmconfig.h.*: Don't dllimport on MinGW
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] g[d|t]kmmconfig.h.*: Don't dllimport on MinGW
- Date: Tue, 9 Mar 2021 08:59:02 +0000 (UTC)
commit 86685b604692b5d93f51a1d886786352c921dc51
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Mar 9 16:16:29 2021 +0800
g[d|t]kmmconfig.h.*: Don't dllimport on MinGW
This will fix warnings when building items using gdkmm and gtkmm with
MinGW/GCC.
Fixes: https://gitlab.gnome.org/GNOME/gtkmm/-/issues/90
gdk/gdkmmconfig.h.in | 4 +++-
gdk/gdkmmconfig.h.meson | 4 +++-
gtk/gtkmmconfig.h.in | 4 +++-
gtk/gtkmmconfig.h.meson | 4 +++-
4 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gdk/gdkmmconfig.h.in b/gdk/gdkmmconfig.h.in
index 14e68bd2..700c1c82 100644
--- a/gdk/gdkmmconfig.h.in
+++ b/gdk/gdkmmconfig.h.in
@@ -23,8 +23,10 @@
#ifdef GDKMM_DLL
# if defined (GDKMM_BUILD) || defined (GTKMM_BUILD)
# define GDKMM_API __declspec(dllexport)
-# else
+# elif !defined (__GNUC__)
# define GDKMM_API __declspec(dllimport)
+# else /* don't dllimport classes/methods on GCC/MinGW */
+# define GDKMM_API
# endif /* GDKMM_BUILD */
#else
/* Build a static library or a non-native-Windows library */
diff --git a/gdk/gdkmmconfig.h.meson b/gdk/gdkmmconfig.h.meson
index 72850c5e..908c5a07 100644
--- a/gdk/gdkmmconfig.h.meson
+++ b/gdk/gdkmmconfig.h.meson
@@ -23,8 +23,10 @@
#ifdef GDKMM_DLL
# if defined (GDKMM_BUILD) || defined (GTKMM_BUILD)
# define GDKMM_API __declspec(dllexport)
-# else
+# elif !defined (__GNUC__)
# define GDKMM_API __declspec(dllimport)
+# else /* don't dllimport classes/methods on GCC/MinGW */
+# define GDKMM_API
# endif /* GDKMM_BUILD */
#else
/* Build a static library or a non-native-Windows library */
diff --git a/gtk/gtkmmconfig.h.in b/gtk/gtkmmconfig.h.in
index 94d0eaac..7c56af64 100644
--- a/gtk/gtkmmconfig.h.in
+++ b/gtk/gtkmmconfig.h.in
@@ -26,8 +26,10 @@
#ifdef GTKMM_DLL
# if defined (GDKMM_BUILD) || defined(GTKMM_BUILD)
# define GTKMM_API __declspec(dllexport)
-# else
+# elif !defined (__GNUC__)
# define GTKMM_API __declspec(dllimport)
+# else /* don't dllimport classes/methods on GCC/MinGW */
+# define GTKMM_API
# endif
#else
/* Build a static library or a non-native Windows library */
diff --git a/gtk/gtkmmconfig.h.meson b/gtk/gtkmmconfig.h.meson
index dd70c988..ebc00316 100644
--- a/gtk/gtkmmconfig.h.meson
+++ b/gtk/gtkmmconfig.h.meson
@@ -26,8 +26,10 @@
#ifdef GTKMM_DLL
# if defined (GDKMM_BUILD) || defined(GTKMM_BUILD)
# define GTKMM_API __declspec(dllexport)
-# else
+# elif !defined (__GNUC__)
# define GTKMM_API __declspec(dllimport)
+# else /* don't dllimport classes/methods on GCC/MinGW */
+# define GTKMM_API
# endif
#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]