PYVER=2.3
elif [ "$1" = "24" ]; then
PYVER=2.4
+ elif [ "$1" = "25" ]; then
+ PYVER=2.5
else
echo You must specify Python version as first parameter.
exit
22 | 2.2) VER=22; shift ;;
23 | 2.3) VER=23; shift ;;
24 | 2.4) VER=24; shift ;;
+ 25 | 2.5) VER=25; shift ;;
*) VER=24
esac
#endif
+// Python 2.5 changes the type of some API parameter and return types. Using
+// this typedef for versions < 2.5 will help with the transition...
+#if PY_VERSION_HEX < 0x02050000
+typedef int Py_ssize_t;
+#endif
+
+
#ifndef wxPyUSE_EXPORTED_API
// For Python --> C++
%RenameCtor(BitmapFromBits, wxBitmap(PyObject* bits, int width, int height, int depth=1 ))
{
- char* buf;
- int length;
+ char* buf;
+ Py_ssize_t length;
PyString_AsStringAndSize(bits, &buf, &length);
return new wxBitmap(buf, width, height, depth);
}
str = PyObject_Str(source);
if (PyErr_Occurred()) return NULL;
}
- char* tmpPtr; int tmpSize;
+ char* tmpPtr; Py_ssize_t tmpSize;
PyString_AsStringAndSize(str, &tmpPtr, &tmpSize);
target = new wxString(tmpPtr, tmpSize);
str = PyObject_Str(source);
if (PyErr_Occurred()) return wxEmptyString; // TODO: should we PyErr_Clear?
}
- char* tmpPtr; int tmpSize;
+ char* tmpPtr; Py_ssize_t tmpSize;
PyString_AsStringAndSize(str, &tmpPtr, &tmpSize);
target = wxString(tmpPtr, tmpSize);