forked from boostorg/config
Merge all config diffs from trunk
[SVN r62379]
This commit is contained in:
1 parent
4ce3e43a4e
commit
49e17b082e
41 files changed
+1851
-119
No files matched your search
@@ -172,6 +172,25 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_NO_COMPLETE_VALUE_INITIALIZATION</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Compiler
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Compiler has not completely implemented value-initialization. See
|
||||
also <a href="../../../../utility/value_init.htm#compiler_issues" target="_top">The
|
||||
Utility/Value Init docs</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_NO_CTYPE_FUNCTIONS</span></code>
|
||||
@@ -1341,23 +1360,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_HAS_DECLSPEC</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Compiler
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
The compiler uses <code class="computeroutput"><span class="identifier">__declspec</span><span class="special">(</span><span class="identifier">dllexport</span><span class="special">)</span></code> and <code class="computeroutput"><span class="identifier">__declspec</span><span class="special">(</span><span class="identifier">dllimport</span><span class="special">)</span></code> to export/import symbols from dll's.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_HAS_DIRENT_H</span></code>
|
||||
@@ -2634,7 +2636,7 @@
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_NO_EXPLICIT_CONVERSION_OPERATIONS</span></code>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_NO_EXPLICIT_CONVERSION_OPERATORS</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
@@ -2652,8 +2654,8 @@
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
The compiler does not support explicit instantiation declarations
|
||||
for templates (<code class="computeroutput"><span class="keyword">explicit</span> <span class="keyword">template</span></code>).
|
||||
The compiler does not support explicit instantiation forward declarations
|
||||
for templates (<code class="computeroutput"><span class="keyword">extern</span> <span class="keyword">template</span> <span class="special">...</span></code>).
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -3311,6 +3313,23 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_CLANG</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">config</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Defined to 1 if the compiler is the Clang compiler.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_WINDOWS</span></code>
|
||||
@@ -3427,6 +3446,8 @@
|
||||
for libraries with separate source code</a>
|
||||
</h3></div></div></div>
|
||||
<div class="toc"><dl>
|
||||
<dt><span class="section"><a href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.macros_controlling_shared_library_symbol_visibility">Macros
|
||||
controlling shared library symbol visibility</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.abi_fixing">ABI
|
||||
Fixing</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.automatic_library_selection">Automatic
|
||||
@@ -3434,10 +3455,178 @@
|
||||
</dl></div>
|
||||
<p>
|
||||
The following macros and helper headers are of use to authors whose libraries
|
||||
include separate source code, and are intended to address two issues: fixing
|
||||
the ABI of the compiled library, and selecting which compiled library to
|
||||
link against based upon the compilers settings.
|
||||
include separate source code, and are intended to address several issues:
|
||||
</p>
|
||||
<div class="itemizedlist"><ul type="disc">
|
||||
<li>
|
||||
Controlling shared library symbol visibility
|
||||
</li>
|
||||
<li>
|
||||
Fixing the ABI of the compiled library
|
||||
</li>
|
||||
<li>
|
||||
Selecting which compiled library to link against based upon the compilers
|
||||
settings
|
||||
</li>
|
||||
</ul></div>
|
||||
<p>
|
||||
See <a href="http://svn.boost.org/trac/boost/wiki/Guidelines/Separate" target="_top">Guidelines
|
||||
for Authors of Boost Libraries Containing Separate Source</a>
|
||||
</p>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.macros_controlling_shared_library_symbol_visibility"></a><a class="link" href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.macros_controlling_shared_library_symbol_visibility" title="Macros controlling shared library symbol visibility">Macros
|
||||
controlling shared library symbol visibility</a>
|
||||
</h4></div></div></div>
|
||||
<p>
|
||||
Some compilers support C++ extensions that control which symbols will be
|
||||
exported from shared libraries such as dynamic shared objects (DSO's) on
|
||||
Unix-like systems or dynamic-link libraries (DLL's) on Windows.
|
||||
</p>
|
||||
<p>
|
||||
The Microsoft VC++ compiler has long supplied <code class="computeroutput"><span class="identifier">__declspec</span><span class="special">(</span><span class="identifier">dllexport</span><span class="special">)</span></code> and <code class="computeroutput"><span class="identifier">__declspec</span><span class="special">(</span><span class="identifier">dllimport</span><span class="special">)</span></code> extensions for this purpose, as do virtually
|
||||
all other compilers targeting the Windows platform.
|
||||
</p>
|
||||
<p>
|
||||
Modern versions of the GNU GCC compiler provide the <code class="computeroutput"><span class="identifier">__attribute__</span><span class="special">((</span><span class="identifier">visibility</span><span class="special">(</span><span class="string">"default"</span><span class="special">)))</span></code> extension to indicate that a symbol
|
||||
should be exported. All other symbols may be hidden by using the <code class="computeroutput"><span class="special">-</span><span class="identifier">fvisibility</span><span class="special">-</span><span class="identifier">hidden</span></code>
|
||||
or <code class="computeroutput"><span class="special">-</span><span class="identifier">fvisibility</span><span class="special">-</span><span class="identifier">ms</span><span class="special">-</span><span class="identifier">compat</span></code> compiler switches.
|
||||
</p>
|
||||
<p>
|
||||
Boost supplies several macros to make it easier to manage symbol visibility
|
||||
in a way that is portable between compilers and operating systems.
|
||||
</p>
|
||||
<div class="informaltable"><table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Macro
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
Description
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_SYMBOL_EXPORT</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Defines the syntax of a C++ language extension that indicates a
|
||||
symbol is to be exported from a shared library. If the compiler
|
||||
has no such extension, the macro is defined with no replacement
|
||||
text.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_SYMBOL_IMPORT</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Defines the syntax of a C++ language extension that indicates a
|
||||
symbol is to be imported from a shared library. If the compiler
|
||||
has no such extension, the macro is defined with no replacement
|
||||
text.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_SYMBOL_VISIBLE</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Defines the syntax of a C++ language extension that indicates a
|
||||
symbol is to be globally visible. If the compiler has no such extension,
|
||||
the macro is defined with no replacement text. Needed for classes
|
||||
that are not otherwise exported, but are used by RTTI. Examples
|
||||
include class for objects that will be thrown as exceptions or
|
||||
used in dynamic_casts, across shared library boundaries. For example,
|
||||
a header-only exception class might look like this:
|
||||
</p>
|
||||
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">class</span> <span class="identifier">BOOST_SYMBOL_VISIBLE</span> <span class="identifier">my_exception</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span> <span class="special">{</span> <span class="special">...</span> <span class="special">};</span>
|
||||
</pre>
|
||||
<p>
|
||||
Without BOOST_SYMBOL_VISIBLE, it would be impossible to catch my_exception
|
||||
thrown from a shared library compiled by GCC with the -fvisibility=hidden
|
||||
option.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_HAS_DECLSPEC</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
The compiler has C++ extensions <code class="computeroutput"><span class="identifier">__declspec</span><span class="special">(</span><span class="identifier">dllexport</span><span class="special">)</span></code> and <code class="computeroutput"><span class="identifier">__declspec</span><span class="special">(</span><span class="identifier">dllimport</span><span class="special">)</span></code> to control export/import of symbols
|
||||
from shared libraries. <span class="emphasis"><em>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.</em></span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
<p>
|
||||
Typical usage:
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>boost/foo/config.hpp</strong></span>
|
||||
</p>
|
||||
<pre class="programlisting"><span class="special">...</span>
|
||||
<span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_ALL_DYN_LINK</span><span class="special">)</span> <span class="special">||</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_FOO_DYN_LINK</span><span class="special">)</span>
|
||||
<span class="preprocessor"># if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_FOO_SOURCE</span><span class="special">)</span>
|
||||
<span class="preprocessor"># define</span> <span class="identifier">BOOST_FOO_DECL</span> <span class="identifier">BOOST_SYMBOL_EXPORT</span>
|
||||
<span class="preprocessor"># else</span>
|
||||
<span class="preprocessor"># define</span> <span class="identifier">BOOST_FOO_DECL</span> <span class="identifier">BOOST_SYMBOL_IMPORT</span>
|
||||
<span class="preprocessor"># endif</span>
|
||||
<span class="preprocessor">#else</span>
|
||||
<span class="preprocessor"># define</span> <span class="identifier">BOOST_FOO_DECL</span>
|
||||
<span class="preprocessor">#endif</span>
|
||||
<span class="special">...</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>boost/foo/foo.hpp</strong></span>
|
||||
</p>
|
||||
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">foo</span><span class="special">/</span><span class="identifier">config</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
<span class="special">...</span>
|
||||
<span class="keyword">class</span> <span class="identifier">BOOST_FOO_DECL</span> <span class="identifier">bar</span> <span class="special">{</span> <span class="special">...</span> <span class="special">};</span>
|
||||
<span class="special">...</span>
|
||||
<span class="keyword">void</span> <span class="identifier">BOOST_FOO_DECL</span> <span class="identifier">f</span><span class="special">();</span>
|
||||
<span class="special">...</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>boost/libs/foo/src/foo.cpp</strong></span>
|
||||
</p>
|
||||
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_FOO_SOURCE</span>
|
||||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">foo</span><span class="special">/</span><span class="identifier">foo</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
<span class="special">...</span>
|
||||
<span class="keyword">void</span> <span class="identifier">BOOST_FOO_DECL</span> <span class="identifier">f</span><span class="special">()</span>
|
||||
<span class="special">{</span>
|
||||
<span class="special">...</span>
|
||||
<span class="special">}</span>
|
||||
<span class="special">...</span>
|
||||
</pre>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.abi_fixing"></a><a class="link" href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.abi_fixing" title="ABI Fixing">ABI
|
||||
|
||||
Reference in new issue
Block a user