summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-22 04:41:47 +0000
committermidipix <writeonce@midipix.org>2024-02-22 04:48:31 +0000
commit2accd1d80cf6b32cb42130c21cf3feadc42f87cd (patch)
treec99164c603086d60d83d7081a31c29309b6d9e4c
parent4c3598a30c33daf9e49c1db9db01a32b70f3e5a6 (diff)
downloadslibtool-2accd1d80cf6b32cb42130c21cf3feadc42f87cd.tar.bz2
slibtool-2accd1d80cf6b32cb42130c21cf3feadc42f87cd.tar.xz
code base: internal (hidden) visibility: properly support legacy PE targets.
-rw-r--r--src/internal/slibtool_visibility_impl.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/internal/slibtool_visibility_impl.h b/src/internal/slibtool_visibility_impl.h
index 7b1e50f..2bdded0 100644
--- a/src/internal/slibtool_visibility_impl.h
+++ b/src/internal/slibtool_visibility_impl.h
@@ -1,10 +1,26 @@
#ifndef SLIBTOOL_VISIBILITY_IMPL_H
#define SLIBTOOL_VISIBILITY_IMPL_H
+/**********************************************************************/
+/* PE targets: __dllexport suffices for the purpose of exporting only */
+/* the desired subset of global symbols; this makes the visibility */
+/* attribute not only redundant, but also tricky if not properly */
+/* supported by the toolchain. */
+/* */
+/* When targeting Midipix, __PE__, __dllexport and __dllimport are */
+/* always defined by the toolchain. Otherwise, the absnece of these */
+/* macros has been detected by sofort's ccenv.sh during ./configure, */
+/* and they have accordingly been added to CFLAGS_OS. */
+/**********************************************************************/
+
+#ifdef __PE__
+#define slbt_hidden
+#else
#ifdef _ATTR_VISIBILITY_HIDDEN
#define slbt_hidden _ATTR_VISIBILITY_HIDDEN
#else
#define slbt_hidden
#endif
+#endif
#endif