#22 Fix hash_handler prototype in python-3.2

None
closed
nobody
None
5
2013-06-18
2011-12-23
Michael Gilbert
No

hash_handler has the following prototype in cxx_extensions.cxx:

long hash_handler( PyObject * );

In python-3.2, the long needs to be changed to Py_hash_t, which is really just an ssize_t. Failure to do so causes problems on x86 when largefile mode is enabled, where sizeof(ssize_t) == 8 but sizeof(long) == 4.

See also:
https://bugs.gentoo.org/show_bug.cgi?id=369329

Discussion

  • Never mind my babbling about sizeof(ssize_t).

    The problem is actually that ssize_t is an int on x86, rather than a long. A simple type mismatch. The solution is the same.

     
    • status: open --> closed
    • Group: -->
     
  • PyCXX assumes python 3.2 or later now.
    The type has been fixed.