On Fri, Oct 9, 2009 at 2:11 PM, Robert Bradshaw
<[email protected]> wrote:
> On Oct 9, 2009, at 1:58 AM, Dag Sverre Seljebotn wrote:
>
> P.S. Defining ssize_t, even as an alias to Py_ssize_t (are they ever
> different?)
>

In old Python, Py_ssize_t is just a 'int', see our own generated C code:

#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN


I think that for Python<2.5, we could try to use the "correct" ssize_t
in 64 bits, despite the fact that Py<2.4 does not properly support
64-bits... Honestly, I do not know what would be the proper things to
do here... Python 2.4 is still in use, NumPy still supports it...

I guess a Cython user would accept aht Py_ssize_t it is a 'int' in old
Python (after all, the Py_ prefix indicates it is Python-specific),
but I guess that Cython code with "sizeof(ssize_t)== sizeof(void*)"
evaluating to false would be really disturbing...


>
> would still probably be a good idea.
>

Indeed... Let's wait a bit for more input... Then I could start hacking a patch.



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to