summaryrefslogtreecommitdiffhomepage
path: root/src/internal/perk_visibility_impl.h
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2025-05-29 21:07:22 +0000
committermidipix <writeonce@midipix.org>2025-05-29 22:02:07 +0000
commit2baf678ee420b74c3b08a225f111787645ac18a6 (patch)
tree3820388cd96464fcce23947a851cee3dc0100a1f /src/internal/perk_visibility_impl.h
parentfb9d36cced3944104441b68db3102f9697051670 (diff)
downloadperk-2baf678ee420b74c3b08a225f111787645ac18a6.tar.bz2
perk-2baf678ee420b74c3b08a225f111787645ac18a6.tar.xz
code base: set the visilbity of internal library interfaces to hidden.
Diffstat (limited to 'src/internal/perk_visibility_impl.h')
-rw-r--r--src/internal/perk_visibility_impl.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/internal/perk_visibility_impl.h b/src/internal/perk_visibility_impl.h
new file mode 100644
index 0000000..df45efc
--- /dev/null
+++ b/src/internal/perk_visibility_impl.h
@@ -0,0 +1,26 @@
+#ifndef PERK_VISIBILITY_IMPL_H
+#define PERK_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 perk_hidden
+#else
+#ifdef _ATTR_VISIBILITY_HIDDEN
+#define perk_hidden _ATTR_VISIBILITY_HIDDEN
+#else
+#define perk_hidden
+#endif
+#endif
+
+#endif