[pangomm/use-dllexport: 8/13] pango/pangommconfig.h.*: Add PANGOMM_API



commit 01c66d61ac150bdcd20be00debe68e1626bb7c33
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]