[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master b29be96 09/10: Extend in the spirit of ELF vi
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master b29be96 09/10: Extend in the spirit of ELF visibility |
Date: |
Sat, 11 Mar 2017 17:24:21 -0500 (EST) |
branch: master
commit b29be9628dcc5c49aa198f2e3a58dd401637ea31
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Extend in the spirit of ELF visibility
See the ELF visibility patch author's work, cited inline. The "hidden"
and "public" macros are not presently used in lmi, but presumably they
will prove useful later.
---
so_attributes.hpp | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/so_attributes.hpp b/so_attributes.hpp
index 37d4585..bd7bc6a 100644
--- a/so_attributes.hpp
+++ b/so_attributes.hpp
@@ -56,7 +56,10 @@
// compatible attribute for symbol visibility, a feature for which
// significant benefits are claimed:
// http://www.nedprod.com/programs/gccvisibility.html
+// [if that becomes inaccessible, this began as a copy:
// https://gcc.gnu.org/wiki/Visibility
+// but, being a wiki, it has been subject to erosion; the
+// implementation here is closer to the authoritative original]
// The elf 'visibility' and msw dll 'declspec' attributes are similar
// enough to use the same decoration macro, but they do different
// things. In code that uses the shared object, the macro has an
@@ -74,11 +77,15 @@
#if defined LMI_USE_SO_ATTRIBUTES
#
# if defined LMI_MSW
-# define LMI_EXPORT __declspec(dllexport)
# define LMI_IMPORT __declspec(dllimport)
+# define LMI_EXPORT __declspec(dllexport)
+# define LMI_HIDDEN
+# define LMI_PUBLIC
# elif defined __GNUC__
-# define LMI_EXPORT __attribute__((visibility("default")))
# define LMI_IMPORT
+# define LMI_EXPORT __attribute__((visibility("default")))
+# define LMI_HIDDEN __attribute__((visibility("hidden")))
+# define LMI_PUBLIC __attribute__((visibility("default")))
# else // !defined LMI_MSW && !defined __GNUC__
# error Unknown platform. Consider contributing support.
# endif // !defined LMI_MSW && !defined __GNUC__
- [lmi-commits] [lmi] master updated (e41c2a5 -> 14a3331), Greg Chicares, 2017/03/11
- [lmi-commits] [lmi] master 4d5ba79 03/10: Improve #error messages, Greg Chicares, 2017/03/11
- [lmi-commits] [lmi] master a1d3016 01/10: Improve a MinGW conditional, Greg Chicares, 2017/03/11
- [lmi-commits] [lmi] master cdd64d2 04/10: Remove a superannuated gcc conditional, Greg Chicares, 2017/03/11
- [lmi-commits] [lmi] master 649d990 02/10: Improve documentation, Greg Chicares, 2017/03/11
- [lmi-commits] [lmi] master d5d71f8 08/10: Refactor for simplicity, Greg Chicares, 2017/03/11
- [lmi-commits] [lmi] master 58c9fdf 05/10: Make a precondition check unconditional, Greg Chicares, 2017/03/11
- [lmi-commits] [lmi] master a4d4c24 06/10: Treat unknown platform as an error, uniformly, Greg Chicares, 2017/03/11
- [lmi-commits] [lmi] master b1c6af9 07/10: Use similar logic for ELF and PE-COFF, Greg Chicares, 2017/03/11
- [lmi-commits] [lmi] master b29be96 09/10: Extend in the spirit of ELF visibility,
Greg Chicares <=
- [lmi-commits] [lmi] master 14a3331 10/10: Reuse recent so_attributes work for wx_new [394], Greg Chicares, 2017/03/11