summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2021-03-08 12:01:43 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2021-03-08 12:33:54 +0800
commit21f6acefc23d18339f6aa032e8142bd5c81283f4 (patch)
treedb3d391138664956e4593b9e320372e71552378f
parent41df70885c9a367de1e9e88f0b992778b60a0025 (diff)
downloadglibmm-fix.gcc.win32.warnings.266.tar.gz
g[io|lib]mmconfig.h.*: Don't dllimport on MinGWfix.gcc.win32.warnings.266
This will fix warnings when building items using glibmm and giomm with MinGW/GCC. Please see: https://gitlab.gnome.org/GNOME/gtkmm/-/issues/90
-rw-r--r--gio/giommconfig.h.in4
-rw-r--r--gio/giommconfig.h.meson4
-rw-r--r--glib/glibmmconfig.h.in4
-rw-r--r--glib/glibmmconfig.h.meson4
4 files changed, 12 insertions, 4 deletions
diff --git a/gio/giommconfig.h.in b/gio/giommconfig.h.in
index b9579c6e..714ad879 100644
--- a/gio/giommconfig.h.in
+++ b/gio/giommconfig.h.in
@@ -26,8 +26,10 @@
#ifdef GIOMM_DLL
# if defined(GIOMM_BUILD)
# define GIOMM_API __declspec(dllexport)
-# else
+# elif !defined (__GNUC__)
# define GIOMM_API __declspec(dllimport)
+# else /* don't dllimport classes/methods on GCC/MinGW */
+# define GIOMM_API
# endif
/* Build a static library or non-native-Windows library */
#else
diff --git a/gio/giommconfig.h.meson b/gio/giommconfig.h.meson
index 9ac31c6d..41232323 100644
--- a/gio/giommconfig.h.meson
+++ b/gio/giommconfig.h.meson
@@ -26,8 +26,10 @@
#ifdef GIOMM_DLL
# if defined(GIOMM_BUILD)
# define GIOMM_API __declspec(dllexport)
-# else
+# elif !defined (__GNUC__)
# define GIOMM_API __declspec(dllimport)
+# else /* don't dllimport classes/methods on GCC/MinGW */
+# define GIOMM_API
# endif
/* Build a static library or non-native-Windows library */
#else
diff --git a/glib/glibmmconfig.h.in b/glib/glibmmconfig.h.in
index ef82084f..0615967c 100644
--- a/glib/glibmmconfig.h.in
+++ b/glib/glibmmconfig.h.in
@@ -138,8 +138,10 @@
#ifdef GLIBMM_DLL
# if defined(GLIBMM_BUILD)
# define GLIBMM_API __declspec(dllexport)
-# else
+# elif !defined (__GNUC__)
# define GLIBMM_API __declspec(dllimport)
+# else /* don't dllimport classes/methods on GCC/MinGW */
+# define GLIBMM_API
# endif /* GLIBMM_BUILD - _WINDLL */
#else
/* Build a static library or a non-native-Windows library */
diff --git a/glib/glibmmconfig.h.meson b/glib/glibmmconfig.h.meson
index 6fff5057..e50dcccf 100644
--- a/glib/glibmmconfig.h.meson
+++ b/glib/glibmmconfig.h.meson
@@ -138,8 +138,10 @@
#ifdef GLIBMM_DLL
# if defined(GLIBMM_BUILD)
# define GLIBMM_API __declspec(dllexport)
-# else
+# elif !defined (__GNUC__)
# define GLIBMM_API __declspec(dllimport)
+# else /* don't dllimport classes/methods on GCC/MinGW */
+# define GLIBMM_API
# endif /* GLIBMM_BUILD - _WINDLL */
#else
/* Build a static library or a non-native-Windows library */