configuration.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Chapter&#160;3.&#160;Configuration</title>
  5. <link rel="stylesheet" href="boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="index.html" title="Boost.Python">
  8. <link rel="up" href="index.html" title="Boost.Python">
  9. <link rel="prev" href="building/notes_for_mingw_and_cygwin_with_.html" title="Notes for MinGW (and Cygwin with -mno-cygwin) GCC Users">
  10. <link rel="next" href="support.html" title="Chapter&#160;4.&#160;Support Resources">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="" width="" height="" src="images/boost.png"></td></tr></table>
  14. <hr>
  15. <div class="spirit-nav">
  16. <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>
  17. </div>
  18. <div class="chapter">
  19. <div class="titlepage"><div>
  20. <div><h1 class="title">
  21. <a name="configuration"></a>Chapter&#160;3.&#160;Configuration</h1></div>
  22. <div><div class="authorgroup"><div class="author"><h3 class="author">
  23. <span class="firstname">David</span> <span class="surname">Abrahams</span>
  24. </h3></div></div></div>
  25. <div><p class="copyright">Copyright &#169; 2002-2015 David Abrahams, Stefan Seefeld</p></div>
  26. </div></div>
  27. <div class="toc"><dl class="toc">
  28. <dt><span class="section"><a href="configuration.html#configuration.configuration">Configuration</a></span></dt>
  29. <dd><dl>
  30. <dt><span class="section"><a href="configuration.html#configuration.configuration.introduction">Introduction</a></span></dt>
  31. <dt><span class="section"><a href="configuration.html#configuration.configuration.application_defined_macros">Application
  32. Defined Macros</a></span></dt>
  33. <dt><span class="section"><a href="configuration.html#configuration.configuration.library_defined_defined_macros">Library
  34. Defined Defined Macros</a></span></dt>
  35. </dl></dd>
  36. </dl></div>
  37. <div class="section">
  38. <div class="titlepage"><div><div><h3 class="title">
  39. <a name="configuration.configuration"></a><a class="link" href="configuration.html#configuration.configuration" title="Configuration">Configuration</a>
  40. </h3></div></div></div>
  41. <div class="toc"><dl class="toc">
  42. <dt><span class="section"><a href="configuration.html#configuration.configuration.introduction">Introduction</a></span></dt>
  43. <dt><span class="section"><a href="configuration.html#configuration.configuration.application_defined_macros">Application
  44. Defined Macros</a></span></dt>
  45. <dt><span class="section"><a href="configuration.html#configuration.configuration.library_defined_defined_macros">Library
  46. Defined Defined Macros</a></span></dt>
  47. </dl></div>
  48. <div class="section">
  49. <div class="titlepage"><div><div><h4 class="title">
  50. <a name="configuration.configuration.introduction"></a><a class="link" href="configuration.html#configuration.configuration.introduction" title="Introduction">Introduction</a>
  51. </h4></div></div></div>
  52. <p>
  53. <span class="bold"><strong>Boost.Python</strong></span> uses several configuration
  54. macros in <code class="computeroutput"><span class="special">&lt;</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">&gt;</span></code>, as well as configuration macros meant
  55. to be supplied by the application. These macros are documented here.
  56. </p>
  57. </div>
  58. <div class="section">
  59. <div class="titlepage"><div><div><h4 class="title">
  60. <a name="configuration.configuration.application_defined_macros"></a><a class="link" href="configuration.html#configuration.configuration.application_defined_macros" title="Application Defined Macros">Application
  61. Defined Macros</a>
  62. </h4></div></div></div>
  63. <p>
  64. These are the macros that may be defined by an application using Boost.Python.
  65. Note that if you extend a strict interpretation of the C++ standard to
  66. cover dynamic libraries, using different values of these macros when compiling
  67. different libraries (including extension modules and the Boost.Python library
  68. itself) is a violation of the <a class="link" href="glossary.html#odr">ODR</a>. However,
  69. we know of no C++ implementations on which this particular violation is
  70. detectable or causes any problems.
  71. </p>
  72. <div class="informaltable"><table class="table">
  73. <colgroup>
  74. <col>
  75. <col>
  76. <col>
  77. </colgroup>
  78. <thead><tr>
  79. <th>
  80. <p>
  81. Macro
  82. </p>
  83. </th>
  84. <th>
  85. <p>
  86. Default
  87. </p>
  88. </th>
  89. <th>
  90. <p>
  91. Meaning
  92. </p>
  93. </th>
  94. </tr></thead>
  95. <tbody>
  96. <tr>
  97. <td>
  98. <p>
  99. BOOST_PYTHON_MAX_ARITY
  100. </p>
  101. </td>
  102. <td>
  103. <p>
  104. 15
  105. </p>
  106. </td>
  107. <td>
  108. <p>
  109. The maximum arity of any function, member function, or constructor
  110. to be wrapped, invocation of a Boost.Python function wich is
  111. specified as taking arguments x1, x2,...Xn. This includes, in
  112. particular, callback mechanisms such as object::operator()(...)
  113. or call_method&lt;R&gt;(... ).
  114. </p>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td>
  119. <p>
  120. BOOST_PYTHON_MAX_BASES
  121. </p>
  122. </td>
  123. <td>
  124. <p>
  125. 10
  126. </p>
  127. </td>
  128. <td>
  129. <p>
  130. The maximum number of template arguments to the <code class="computeroutput"><span class="identifier">bases</span><span class="special">&lt;...&gt;</span></code>
  131. class template, which is used to specify the bases of a wrapped
  132. C++ class..
  133. </p>
  134. </td>
  135. </tr>
  136. <tr>
  137. <td>
  138. <p>
  139. BOOST_PYTHON_STATIC_MODULE
  140. </p>
  141. </td>
  142. <td>
  143. <p>
  144. <span class="emphasis"><em>not defined</em></span>
  145. </p>
  146. </td>
  147. <td>
  148. <p>
  149. If defined, prevents your module initialization function from
  150. being treated as an exported symbol on platforms which support
  151. that distinction in-code
  152. </p>
  153. </td>
  154. </tr>
  155. <tr>
  156. <td>
  157. <p>
  158. BOOST_PYTHON_ENABLE_CDECL
  159. </p>
  160. </td>
  161. <td>
  162. <p>
  163. <span class="emphasis"><em>not defined</em></span>
  164. </p>
  165. </td>
  166. <td>
  167. <p>
  168. If defined, allows functions using the <code class="computeroutput"><span class="identifier">__cdecl</span></code>
  169. calling convention to be wrapped.
  170. </p>
  171. </td>
  172. </tr>
  173. <tr>
  174. <td>
  175. <p>
  176. BOOST_PYTHON_ENABLE_STDCALL
  177. </p>
  178. </td>
  179. <td>
  180. <p>
  181. <span class="emphasis"><em>not defined</em></span>
  182. </p>
  183. </td>
  184. <td>
  185. <p>
  186. If defined, allows functions using the <code class="computeroutput"><span class="identifier">__stdcall</span></code>
  187. calling convention to be wrapped.
  188. </p>
  189. </td>
  190. </tr>
  191. <tr>
  192. <td>
  193. <p>
  194. BOOST_PYTHON_ENABLE_FASTCALL
  195. </p>
  196. </td>
  197. <td>
  198. <p>
  199. <span class="emphasis"><em>not defined</em></span>
  200. </p>
  201. </td>
  202. <td>
  203. <p>
  204. If defined, allows functions using the <code class="computeroutput"><span class="identifier">__fastcall</span></code>
  205. calling convention to be wrapped.
  206. </p>
  207. </td>
  208. </tr>
  209. </tbody>
  210. </table></div>
  211. </div>
  212. <div class="section">
  213. <div class="titlepage"><div><div><h4 class="title">
  214. <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
  215. Defined Defined Macros</a>
  216. </h4></div></div></div>
  217. <p>
  218. These macros are defined by <span class="bold"><strong>Boost.Python</strong></span>
  219. and are implementation details of interest only to implementors and those
  220. porting to new platforms.
  221. </p>
  222. <div class="informaltable"><table class="table">
  223. <colgroup>
  224. <col>
  225. <col>
  226. <col>
  227. </colgroup>
  228. <thead><tr>
  229. <th>
  230. <p>
  231. Macro
  232. </p>
  233. </th>
  234. <th>
  235. <p>
  236. Default
  237. </p>
  238. </th>
  239. <th>
  240. <p>
  241. Meaning
  242. </p>
  243. </th>
  244. </tr></thead>
  245. <tbody>
  246. <tr>
  247. <td>
  248. <p>
  249. BOOST_PYTHON_TYPE_ID_NAME
  250. </p>
  251. </td>
  252. <td>
  253. <p>
  254. <span class="emphasis"><em>not defined</em></span>
  255. </p>
  256. </td>
  257. <td>
  258. <p>
  259. If defined, this indicates that the type_info comparison across
  260. shared library boundaries does not work on this platform. In
  261. 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
  262. 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
  263. <code class="computeroutput"><span class="keyword">false</span></code>. If this macro
  264. 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
  265. the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">type_info</span></code> objects directly.
  266. </p>
  267. </td>
  268. </tr>
  269. <tr>
  270. <td>
  271. <p>
  272. BOOST_PYTHON_NO_PY_SIGNATURES
  273. </p>
  274. </td>
  275. <td>
  276. <p>
  277. <span class="emphasis"><em>not defined</em></span>
  278. </p>
  279. </td>
  280. <td>
  281. <p>
  282. If defined for a module no pythonic signatures are generated
  283. for the docstrings of the module functions, and no python type
  284. is associated with any of the converters registered by the module.
  285. This also reduces the binary size of the module by about 14%
  286. (gcc compiled). If defined for the boost_python runtime library,
  287. 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>.
  288. </p>
  289. </td>
  290. </tr>
  291. <tr>
  292. <td>
  293. <p>
  294. BOOST_PYTHON_SUPPORTS_PY_SIGNATURES
  295. </p>
  296. </td>
  297. <td>
  298. <p>
  299. <span class="emphasis"><em>defined</em></span> if <code class="computeroutput"><span class="identifier">BOOST_PYTHON_NO_PY_SIGNATURES</span></code>
  300. is <span class="emphasis"><em>undefined</em></span>
  301. </p>
  302. </td>
  303. <td>
  304. <p>
  305. This macro is defined to enable a smooth transition from older
  306. Boost.Python versions which do not support pythonic signatures.
  307. For example usage see here.
  308. </p>
  309. </td>
  310. </tr>
  311. <tr>
  312. <td>
  313. <p>
  314. BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE
  315. </p>
  316. </td>
  317. <td>
  318. <p>
  319. <span class="emphasis"><em>not defined</em></span>
  320. </p>
  321. </td>
  322. <td>
  323. <p>
  324. If defined the python type of <code class="computeroutput"><span class="identifier">__init__</span></code>
  325. method "self" parameters is properly generated, otherwise
  326. object is used. It is undefined by default because it increases
  327. the binary size of the module by about 14% (gcc compiled).
  328. </p>
  329. </td>
  330. </tr>
  331. </tbody>
  332. </table></div>
  333. </div>
  334. </div>
  335. </div>
  336. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  337. <td align="left"></td>
  338. <td align="right"><div class="copyright-footer">Copyright &#169; 2002-2015 David
  339. Abrahams, Stefan Seefeld<p>
  340. Distributed under the Boost Software License, Version 1.0. (See accompanying
  341. 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>)
  342. </p>
  343. </div></td>
  344. </tr></table>
  345. <hr>
  346. <div class="spirit-nav">
  347. <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>
  348. </div>
  349. </body>
  350. </html>