[pangomm/use-dllexport: 2/7] pango/pangommconfig.h.*: Add PANGOMM_API
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pangomm/use-dllexport: 2/7] pango/pangommconfig.h.*: Add PANGOMM_API
- Date: Wed, 11 Mar 2020 10:42:44 +0000 (UTC)
commit b1080d53f0818ad8480626a026e78c065ed1bcef
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Mar 11 17:59:09 2020 +0800
pango/pangommconfig.h.*: Add PANGOMM_API
This prepares for decoration of the various APIs in pangomm so that we
can export symbols at least on Visual Studio buids using compiler
directives, without the need of gendef.exe.
pango/pangommconfig.h.in | 16 ++++++++++++++++
pango/pangommconfig.h.meson | 16 ++++++++++++++++
2 files changed, 32 insertions(+)
---
diff --git a/pango/pangommconfig.h.in b/pango/pangommconfig.h.in
index 8ab0305..5c7932c 100644
--- a/pango/pangommconfig.h.in
+++ b/pango/pangommconfig.h.in
@@ -16,4 +16,20 @@
/* Minor version number of pangomm. */
#undef PANGOMM_MINOR_VERSION
+/* Enable DLL-specific stuff only when not building a static library */
+#if !defined(__CYGWIN__) && (defined(__MINGW32__) || defined (_MSC_VER)) && !defined(PANGOMM_STATIC_LIB)
+# define PANGOMM_DLL 1
+#endif
+
+#ifdef PANGOMM_DLL
+# if defined(PANGOMM_BUILD)
+# define PANGOMM_API __declspec(dllexport)
+# else
+# define PANGOMM_API __declspec(dllimport)
+# endif /* PANGOMM_BUILD - _WINDLL */
+#else
+/* Build a static library or a non-native-Windows library */
+# define PANGOMM_API
+#endif /* PANGOMM_DLL */
+
#endif /* !PANGOMM_PANGOMMCONFIG_H_INCLUDED */
diff --git a/pango/pangommconfig.h.meson b/pango/pangommconfig.h.meson
index e28f310..c4dba01 100644
--- a/pango/pangommconfig.h.meson
+++ b/pango/pangommconfig.h.meson
@@ -16,4 +16,20 @@
/* Micro version number of pangomm. */
#mesondefine PANGOMM_MICRO_VERSION
+/* Enable DLL-specific stuff only when not building a static library */
+#if !defined(__CYGWIN__) && (defined(__MINGW32__) || defined (_MSC_VER)) && !defined(PANGOMM_STATIC_LIB)
+# define PANGOMM_DLL 1
+#endif
+
+#ifdef PANGOMM_DLL
+# if defined(PANGOMM_BUILD)
+# define PANGOMM_API __declspec(dllexport)
+# else
+# define PANGOMM_API __declspec(dllimport)
+# endif /* PANGOMM_BUILD - _WINDLL */
+#else
+/* Build a static library or a non-native-Windows library */
+# define PANGOMM_API
+#endif /* PANGOMM_DLL */
+
#endif /* !PANGOMM_PANGOMMCONFIG_H_INCLUDED */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]