[pangomm/use-dllexport-2-42: 1/6] 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-42: 1/6] pango/pangommconfig.h.*: Add PANGOMM_API
- Date: Thu, 2 Apr 2020 06:13:06 +0000 (UTC)
commit f989f09c5c7fd03d852b1c4e113b817efa9d13dd
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, if the headers were
generated from their respective *.hg counterparts with gmmproc 2.64.0 or
later.
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..c410224 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) &&
!defined (PANGOMM_USE_GENDEF)
+# 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..562c9c9 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) &&
!defined (PANGOMM_USE_GENDEF)
+# 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]