1 /* This file is to prevent problems with swig <= 1.3.25 which use
2 PyInt_AS_LONG and may cause some corruption on RedHat systems.
4 Include it in every .i file who generate a C/C++ file */
7 /* define the PyAPI_FUNC macro if it doesn't exist, for example with Python
8 version below 2.3... But not really tested... */
10 # define PyAPI_FUNC(RTYPE) RTYPE
13 /* remove the PyInt_AS_LONG if defined, as this cause problems on RedHat */
18 /* wrapper to the better function PyInt_AsLong, removing problems
19 with RedHat (I hope) */
20 static PyAPI_FUNC(long) PyInt_AS_LONG (PyObject *obj) {
21 return PyInt_AsLong (obj);
24 /* remove the PyFloat_AS_DOUBLE if defined, to prevent errors */
25 #ifdef PyFloat_AS_DOUBLE
26 #undef PyFloat_AS_DOUBLE
29 /* wrapper to the better function PyFloat_AS_DOUBLE, to prevent errors */
30 static PyAPI_FUNC(double) PyFloat_AS_DOUBLE (PyObject *obj) {
31 return PyFloat_AsDouble (obj);