File: python_compatibility.h

package info (click to toggle)
jppy 0.0.56-1.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 9,512 kB
  • ctags: 3,972
  • sloc: ansic: 45,883; sh: 10,974; python: 6,331; yacc: 1,014; makefile: 418
file content (22 lines) | stat: -rw-r--r-- 639 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef PYTHON_COMPAT_H
#define PYTHON_COMPAT_H

/* some things for handling issues with backwards compatibility */

/* Back-compatibility with Python 2.4 */
/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef int Py_ssize_t;
# define PY_SSIZE_T_MAX INT_MAX
# define PY_SSIZE_T_MIN INT_MIN
#endif

/* Should try avoid these I think, by rewriting our functions to take
   PyObject* rather than our own types */
#if PY_VERSION_HEX < 0x02050000
typedef inquiry lenfunc;
typedef intargfunc ssizeargfunc;
typedef intobjargproc ssizeobjargproc;
#endif

#endif