...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Boost.Python uses several configuration
macros in <boost/config.hpp>
, as well as configuration macros meant
to be supplied by the application. These macros are documented here.
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 ODR. However, we know of no C++ implementations on which this particular violation is detectable or causes any problems.
Macro |
Default |
Meaning |
---|---|---|
BOOST_PYTHON_MAX_ARITY |
15 |
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>(... ). |
BOOST_PYTHON_MAX_BASES |
10 |
The maximum number of template arguments to the |
BOOST_PYTHON_STATIC_MODULE |
not defined |
If defined, prevents your module initialization function from being treated as an exported symbol on platforms which support that distinction in-code |
BOOST_PYTHON_ENABLE_CDECL |
not defined |
If defined, allows functions using the |
BOOST_PYTHON_ENABLE_STDCALL |
not defined |
If defined, allows functions using the |
BOOST_PYTHON_ENABLE_FASTCALL |
not defined |
If defined, allows functions using the |
These macros are defined by Boost.Python and are implementation details of interest only to implementors and those porting to new platforms.
Macro |
Default |
Meaning |
---|---|---|
BOOST_PYTHON_TYPE_ID_NAME |
not defined |
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 |
BOOST_PYTHON_NO_PY_SIGNATURES |
not defined |
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 |
BOOST_PYTHON_SUPPORTS_PY_SIGNATURES |
defined if |
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. |
BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE |
not defined |
If defined the python type of |