|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | +<!-- Copyright Ralf W. Grosse-Kunstleve 2006. Distributed under the Boost --> |
| 3 | +<!-- Software License, Version 1.0. (See accompanying --> |
| 4 | +<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> |
| 5 | + |
| 6 | +<html> |
| 7 | +<head> |
| 8 | + <meta name="generator" content= |
| 9 | + "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org"> |
| 10 | + <meta http-equiv="Content-Type" content= |
| 11 | + "text/html; charset=us-ascii"> |
| 12 | + <link rel="stylesheet" type="text/css" href="../boost.css"> |
| 13 | + |
| 14 | + <title>Boost.Python - <boost/python/ssize_t.hpp></title> |
| 15 | +</head> |
| 16 | + |
| 17 | +<body> |
| 18 | + <table border="0" cellpadding="7" cellspacing="0" width="100%" |
| 19 | + summary="header"> |
| 20 | + <tr> |
| 21 | + <td valign="top" width="300"> |
| 22 | + <h3><a href="../../../../index.htm"><img height="86" width= |
| 23 | + "277" alt="C++ Boost" src="../../../../boost.png" border= |
| 24 | + "0"></a></h3> |
| 25 | + </td> |
| 26 | + |
| 27 | + <td valign="top"> |
| 28 | + <h1 align="center"><a href= |
| 29 | + "../index.html">Boost.Python</a></h1> |
| 30 | + |
| 31 | + <h2 align="center">Header |
| 32 | + <boost/python/ssize_t.hpp></h2> |
| 33 | + </td> |
| 34 | + </tr> |
| 35 | + </table> |
| 36 | + <hr> |
| 37 | + |
| 38 | + <h2>Contents</h2> |
| 39 | + |
| 40 | + <dl class="page-index"> |
| 41 | + <dt><a href="#introduction">Introduction</a></dt> |
| 42 | + |
| 43 | + <dt><a href="#typdefs">Typedef</a></dt> |
| 44 | + |
| 45 | + <dt><a href="#macros">Constants</a></dt> |
| 46 | + </dl> |
| 47 | + <hr> |
| 48 | + |
| 49 | + <h2><a name="introduction" id= |
| 50 | + "introduction"></a>Introduction</h2> |
| 51 | + |
| 52 | + <p>Python 2.5 introduces a new <tt>Py_ssize_t</tt> typedef and |
| 53 | + two related macros (<a href= |
| 54 | + "http://www.python.org/dev/peps/pep-0353/">PEP 353</a>). The |
| 55 | + <tt><boost/python/ssize_t.hpp></tt> header imports these |
| 56 | + definitions into the <tt>boost::python</tt> namespace as |
| 57 | + <tt>ssize_t</tt>, <tt>ssize_t_max</tt>, and <tt>ssize_t_min</tt>. |
| 58 | + Appropriate definitions are provided for backward compatibility |
| 59 | + with previous Python versions.</p> |
| 60 | + |
| 61 | + <h2><a name="typedefs" id="typedefs"></a>Typedefs</h2>Imports |
| 62 | + <tt>Py_ssize_t</tt> into the <tt>boost::python</tt> namespace if |
| 63 | + available, or provides an appropriate typedef for backward |
| 64 | + compatibility: |
| 65 | + <pre> |
| 66 | +#if PY_VERSION_HEX >= 0x02050000 |
| 67 | +typedef Py_ssize_t ssize_t; |
| 68 | +#else |
| 69 | +typedef int ssize_t; |
| 70 | +#endif |
| 71 | +</pre> |
| 72 | + |
| 73 | + <h2><a name="constants" id="constants"></a>Constants</h2>Imports |
| 74 | + <tt>PY_SSIZE_T_MAX</tt> and <tt>PY_SSIZE_T_MIN</tt> as constants |
| 75 | + into the <tt>boost::python</tt> namespace if available, or |
| 76 | + provides appropriate constants for backward compatibility: |
| 77 | + <pre> |
| 78 | +#if PY_VERSION_HEX >= 0x02050000 |
| 79 | +ssize_t const ssize_t_max = PY_SSIZE_T_MAX; |
| 80 | +ssize_t const ssize_t_min = PY_SSIZE_T_MIN; |
| 81 | +#else |
| 82 | +ssize_t const ssize_t_max = INT_MAX; |
| 83 | +ssize_t const ssize_t_min = INT_MIN; |
| 84 | +#endif |
| 85 | +</pre> |
| 86 | + |
| 87 | + <p>Revised |
| 88 | + <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> |
| 89 | + 25 September, 2006 |
| 90 | + <!--webbot bot="Timestamp" endspan i-checksum="39359" --></p> |
| 91 | + |
| 92 | + <p><i>© Copyright <a href= |
| 93 | + "../../../../people/ralf_w_grosse_kunstleve.htm">Ralf W. |
| 94 | + Grosse-Kunstleve</a> 2006.</i></p> |
| 95 | +</body> |
| 96 | +</html> |
0 commit comments