[gtk/gtk-3-24: 2/4] Define DLL_EXPORT and _GDK_EXTERN depending on whether we are building a shared or a static library




commit ef4e1c473ce430f8cdec3b4fe752ce4a9b0316db
Author: Luca Bacci <luca bacci982 gmail com>
Date:   Thu Mar 3 12:04:51 2022 +0100

    Define DLL_EXPORT and _GDK_EXTERN depending on whether we are building a shared or a static library
    
    Static builds on Windows are only supported in the Meson build

 config.h.meson    |  3 +++
 config.h.win32.in | 13 +++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/config.h.meson b/config.h.meson
index ce2aeb2946..f6716795f9 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -230,6 +230,9 @@
 /* Define to the version of this package. */
 #mesondefine PACKAGE_VERSION
 
+/* Define when building a shared library for Windows */
+#mesondefine DLL_EXPORT
+
 /* Use NSBundle functions to determine load paths for libraries, translations,
    etc. */
 #mesondefine QUARTZ_RELOCATION
diff --git a/config.h.win32.in b/config.h.win32.in
index 9666b1b872..a68a4f20a0 100644
--- a/config.h.win32.in
+++ b/config.h.win32.in
@@ -314,11 +314,16 @@
 /* Number of bits in a file offset, on hosts where this is settable. */
 /* #undef _FILE_OFFSET_BITS */
 
+/* Define when building a shared library for Windows */
+#define DLL_EXPORT 1
+
 /* defines how to decorate public symbols while building */
-#ifdef _MSC_VER
-#define _GDK_EXTERN __declspec (dllexport) extern
-#else
-#define _GDK_EXTERN __attribute__((visibility("default")))  __declspec (dllexport) extern
+#ifdef DLL_EXPORT
+# ifdef _MSC_VER
+#  define _GDK_EXTERN __declspec (dllexport) extern
+# else
+#  define _GDK_EXTERN __attribute__((visibility("default")))  __declspec (dllexport) extern
+# endif
 #endif
 
 /* Define for large files, on AIX-style hosts. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]