[pangomm/use-dllexport-2-42: 9/17] pango/pangommconfig.h.*: Add PANGOMM_API



commit 8458135edbc80a7cbe6f6c2790d3cdca87d5ab96
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]