summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2025-05-31 13:51:57 +0000
committermidipix <writeonce@midipix.org>2025-05-31 15:54:16 +0000
commit39a772abeccd9dc1ee84a63bdf46b15613a60a8e (patch)
tree78f0c8fa9a2f304f590083b2aed52a0c335d1a4a
parent97d87d96ca3bb883754629802f210f487bb37781 (diff)
downloadtreebnf-39a772abeccd9dc1ee84a63bdf46b15613a60a8e.tar.bz2
treebnf-39a772abeccd9dc1ee84a63bdf46b15613a60a8e.tar.xz
code base: utilize the visibility attribute also on supporting PE targets.HEADmain
-rw-r--r--src/internal/treebnf_visibility_impl.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/internal/treebnf_visibility_impl.h b/src/internal/treebnf_visibility_impl.h
index 9599010..8bbc4f8 100644
--- a/src/internal/treebnf_visibility_impl.h
+++ b/src/internal/treebnf_visibility_impl.h
@@ -7,20 +7,20 @@
/* 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. */
+/* When targeting Midipix hosts, where elf-like visibility is fully */
+/* supported and may be detected via the __PE_VISIBILITY__ macro, */
+/* we utilize the attribute to render private symbols invisibile */
+/* to dlsym(), as well as reduce the size of the .gotstrs section. */
/**********************************************************************/
-#ifdef __PE__
+#if defined(__PE_VISIBILITY__)
+#define tbnf_hidden _ATTR_VISIBILITY_HIDDEN
+#elif defined(__PE__)
#define tbnf_hidden
-#else
-#ifdef _ATTR_VISIBILITY_HIDDEN
+#elif defined(_ATTR_VISIBILITY_HIDDEN)
#define tbnf_hidden _ATTR_VISIBILITY_HIDDEN
#else
#define tbnf_hidden
#endif
-#endif
#endif