351 lines
14 KiB
HTML
351 lines
14 KiB
HTML
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||
<title>Chapter 3. Configuration</title>
|
||
<link rel="stylesheet" href="boostbook.css" type="text/css">
|
||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||
<link rel="home" href="index.html" title="Boost.Python">
|
||
<link rel="up" href="index.html" title="Boost.Python">
|
||
<link rel="prev" href="building/notes_for_mingw_and_cygwin_with_.html" title="Notes for MinGW (and Cygwin with -mno-cygwin) GCC Users">
|
||
<link rel="next" href="support.html" title="Chapter 4. Support Resources">
|
||
</head>
|
||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="" width="" height="" src="images/boost.png"></td></tr></table>
|
||
<hr>
|
||
<div class="spirit-nav">
|
||
<a accesskey="p" href="building/notes_for_mingw_and_cygwin_with_.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="support.html"><img src="images/next.png" alt="Next"></a>
|
||
</div>
|
||
<div class="chapter">
|
||
<div class="titlepage"><div>
|
||
<div><h1 class="title">
|
||
<a name="configuration"></a>Chapter 3. Configuration</h1></div>
|
||
<div><div class="authorgroup"><div class="author"><h3 class="author">
|
||
<span class="firstname">David</span> <span class="surname">Abrahams</span>
|
||
</h3></div></div></div>
|
||
<div><p class="copyright">Copyright © 2002-2015 David Abrahams, Stefan Seefeld</p></div>
|
||
</div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="configuration.html#configuration.configuration">Configuration</a></span></dt>
|
||
<dd><dl>
|
||
<dt><span class="section"><a href="configuration.html#configuration.configuration.introduction">Introduction</a></span></dt>
|
||
<dt><span class="section"><a href="configuration.html#configuration.configuration.application_defined_macros">Application
|
||
Defined Macros</a></span></dt>
|
||
<dt><span class="section"><a href="configuration.html#configuration.configuration.library_defined_defined_macros">Library
|
||
Defined Defined Macros</a></span></dt>
|
||
</dl></dd>
|
||
</dl></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h3 class="title">
|
||
<a name="configuration.configuration"></a><a class="link" href="configuration.html#configuration.configuration" title="Configuration">Configuration</a>
|
||
</h3></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="configuration.html#configuration.configuration.introduction">Introduction</a></span></dt>
|
||
<dt><span class="section"><a href="configuration.html#configuration.configuration.application_defined_macros">Application
|
||
Defined Macros</a></span></dt>
|
||
<dt><span class="section"><a href="configuration.html#configuration.configuration.library_defined_defined_macros">Library
|
||
Defined Defined Macros</a></span></dt>
|
||
</dl></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="configuration.configuration.introduction"></a><a class="link" href="configuration.html#configuration.configuration.introduction" title="Introduction">Introduction</a>
|
||
</h4></div></div></div>
|
||
<p>
|
||
<span class="bold"><strong>Boost.Python</strong></span> uses several configuration
|
||
macros in <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>, as well as configuration macros meant
|
||
to be supplied by the application. These macros are documented here.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="configuration.configuration.application_defined_macros"></a><a class="link" href="configuration.html#configuration.configuration.application_defined_macros" title="Application Defined Macros">Application
|
||
Defined Macros</a>
|
||
</h4></div></div></div>
|
||
<p>
|
||
These are the macros that may be defined by an application using Boost.Python.
|
||
Note that if you extend a strict interpretation of the C++ standard to
|
||
cover dynamic libraries, using different values of these macros when compiling
|
||
different libraries (including extension modules and the Boost.Python library
|
||
itself) is a violation of the <a class="link" href="glossary.html#odr">ODR</a>. However,
|
||
we know of no C++ implementations on which this particular violation is
|
||
detectable or causes any problems.
|
||
</p>
|
||
<div class="informaltable"><table class="table">
|
||
<colgroup>
|
||
<col>
|
||
<col>
|
||
<col>
|
||
</colgroup>
|
||
<thead><tr>
|
||
<th>
|
||
<p>
|
||
Macro
|
||
</p>
|
||
</th>
|
||
<th>
|
||
<p>
|
||
Default
|
||
</p>
|
||
</th>
|
||
<th>
|
||
<p>
|
||
Meaning
|
||
</p>
|
||
</th>
|
||
</tr></thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
BOOST_PYTHON_MAX_ARITY
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
15
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The maximum arity of any function, member function, or constructor
|
||
to be wrapped, invocation of a Boost.Python function wich is
|
||
specified as taking arguments x1, x2,...Xn. This includes, in
|
||
particular, callback mechanisms such as object::operator()(...)
|
||
or call_method<R>(... ).
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
BOOST_PYTHON_MAX_BASES
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
10
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The maximum number of template arguments to the <code class="computeroutput"><span class="identifier">bases</span><span class="special"><...></span></code>
|
||
class template, which is used to specify the bases of a wrapped
|
||
C++ class..
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
BOOST_PYTHON_STATIC_MODULE
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<span class="emphasis"><em>not defined</em></span>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
If defined, prevents your module initialization function from
|
||
being treated as an exported symbol on platforms which support
|
||
that distinction in-code
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
BOOST_PYTHON_ENABLE_CDECL
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<span class="emphasis"><em>not defined</em></span>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
If defined, allows functions using the <code class="computeroutput"><span class="identifier">__cdecl</span></code>
|
||
calling convention to be wrapped.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
BOOST_PYTHON_ENABLE_STDCALL
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<span class="emphasis"><em>not defined</em></span>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
If defined, allows functions using the <code class="computeroutput"><span class="identifier">__stdcall</span></code>
|
||
calling convention to be wrapped.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
BOOST_PYTHON_ENABLE_FASTCALL
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<span class="emphasis"><em>not defined</em></span>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
If defined, allows functions using the <code class="computeroutput"><span class="identifier">__fastcall</span></code>
|
||
calling convention to be wrapped.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="configuration.configuration.library_defined_defined_macros"></a><a class="link" href="configuration.html#configuration.configuration.library_defined_defined_macros" title="Library Defined Defined Macros">Library
|
||
Defined Defined Macros</a>
|
||
</h4></div></div></div>
|
||
<p>
|
||
These macros are defined by <span class="bold"><strong>Boost.Python</strong></span>
|
||
and are implementation details of interest only to implementors and those
|
||
porting to new platforms.
|
||
</p>
|
||
<div class="informaltable"><table class="table">
|
||
<colgroup>
|
||
<col>
|
||
<col>
|
||
<col>
|
||
</colgroup>
|
||
<thead><tr>
|
||
<th>
|
||
<p>
|
||
Macro
|
||
</p>
|
||
</th>
|
||
<th>
|
||
<p>
|
||
Default
|
||
</p>
|
||
</th>
|
||
<th>
|
||
<p>
|
||
Meaning
|
||
</p>
|
||
</th>
|
||
</tr></thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
BOOST_PYTHON_TYPE_ID_NAME
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<span class="emphasis"><em>not defined</em></span>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
If defined, this indicates that the type_info comparison across
|
||
shared library boundaries does not work on this platform. In
|
||
other words, if shared-lib-1 passes <code class="computeroutput"><span class="keyword">typeid</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span></code> to a function in shared-lib-2
|
||
which compares it to <code class="computeroutput"><span class="keyword">typeid</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span></code>, that comparison may return
|
||
<code class="computeroutput"><span class="keyword">false</span></code>. If this macro
|
||
is #defined, Boost.Python uses and compares <code class="computeroutput"><span class="keyword">typeid</span><span class="special">(</span><span class="identifier">T</span><span class="special">).</span><span class="identifier">name</span><span class="special">()</span></code> instead of using and comparing
|
||
the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">type_info</span></code> objects directly.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
BOOST_PYTHON_NO_PY_SIGNATURES
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<span class="emphasis"><em>not defined</em></span>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
If defined for a module no pythonic signatures are generated
|
||
for the docstrings of the module functions, and no python type
|
||
is associated with any of the converters registered by the module.
|
||
This also reduces the binary size of the module by about 14%
|
||
(gcc compiled). If defined for the boost_python runtime library,
|
||
the default for the <code class="computeroutput"><span class="identifier">docstring_options</span><span class="special">.</span><span class="identifier">enable_py_signatures</span><span class="special">()</span></code> is set to <code class="computeroutput"><span class="keyword">false</span></code>.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
BOOST_PYTHON_SUPPORTS_PY_SIGNATURES
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<span class="emphasis"><em>defined</em></span> if <code class="computeroutput"><span class="identifier">BOOST_PYTHON_NO_PY_SIGNATURES</span></code>
|
||
is <span class="emphasis"><em>undefined</em></span>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
This macro is defined to enable a smooth transition from older
|
||
Boost.Python versions which do not support pythonic signatures.
|
||
For example usage see here.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<span class="emphasis"><em>not defined</em></span>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
If defined the python type of <code class="computeroutput"><span class="identifier">__init__</span></code>
|
||
method "self" parameters is properly generated, otherwise
|
||
object is used. It is undefined by default because it increases
|
||
the binary size of the module by about 14% (gcc compiled).
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||
<td align="left"></td>
|
||
<td align="right"><div class="copyright-footer">Copyright © 2002-2015 David
|
||
Abrahams, Stefan Seefeld<p>
|
||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||
</p>
|
||
</div></td>
|
||
</tr></table>
|
||
<hr>
|
||
<div class="spirit-nav">
|
||
<a accesskey="p" href="building/notes_for_mingw_and_cygwin_with_.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="support.html"><img src="images/next.png" alt="Next"></a>
|
||
</div>
|
||
</body>
|
||
</html>
|