mirror of
https://github.com/boostorg/config.git
synced 2025-07-31 04:47:16 +02:00
Merge pull request #441 from jcelerier/develop
Add a macro BOOST_DISABLE_EXPLICIT_SYMBOL_VISIBILITY to disable mandatory symbol visibility
This commit is contained in:
@ -1664,6 +1664,15 @@ export/import of symbols from shared libraries.
|
|||||||
['Deprecated. This macro is no longer necessary since BOOST_SYMBOL_EXPORT and BOOST_SYMBOL_IMPORT
|
['Deprecated. This macro is no longer necessary since BOOST_SYMBOL_EXPORT and BOOST_SYMBOL_IMPORT
|
||||||
are now supplied. It is provided to support legacy code.]
|
are now supplied. It is provided to support legacy code.]
|
||||||
]]
|
]]
|
||||||
|
[[`BOOST_DISABLE_EXPLICIT_SYMBOL_VISIBILITY`][
|
||||||
|
Disables the effect of the BOOST_SYMBOL_EXPORT, BOOST_SYMBOL_IMPORT and BOOST_SYMBOL_VISIBLE macros,
|
||||||
|
in order to revert to the default compiler behaviour.
|
||||||
|
Note that this option should never be used if Boost libraries are being linking against dynamically,
|
||||||
|
or if you are building a shared library that exposes Boost types in its public API.
|
||||||
|
It is however advisable when statically-linking against Boost to prevent Boost symbols from leaking from the binary:
|
||||||
|
for instance because you are building a plug-in for a software which may itself use Boost which could cause
|
||||||
|
ODR conflicts.
|
||||||
|
]]
|
||||||
]
|
]
|
||||||
|
|
||||||
Typical usage:
|
Typical usage:
|
||||||
|
@ -47,6 +47,22 @@
|
|||||||
# define BOOST_SYMBOL_VISIBLE
|
# define BOOST_SYMBOL_VISIBLE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// disable explicitly enforced visibility
|
||||||
|
//
|
||||||
|
#if defined(BOOST_DISABLE_EXPLICIT_SYMBOL_VISIBILITY)
|
||||||
|
|
||||||
|
#undef BOOST_SYMBOL_EXPORT
|
||||||
|
#define BOOST_SYMBOL_EXPORT
|
||||||
|
|
||||||
|
#undef BOOST_SYMBOL_IMPORT
|
||||||
|
#define BOOST_SYMBOL_IMPORT
|
||||||
|
|
||||||
|
#undef BOOST_SYMBOL_VISIBLE
|
||||||
|
#define BOOST_SYMBOL_VISIBLE
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// look for long long by looking for the appropriate macros in <limits.h>.
|
// look for long long by looking for the appropriate macros in <limits.h>.
|
||||||
// Note that we use limits.h rather than climits for maximal portability,
|
// Note that we use limits.h rather than climits for maximal portability,
|
||||||
|
Reference in New Issue
Block a user