]> git.saurik.com Git - wxWidgets.git/commitdiff
Changes needed for building with Python 2.5
authorRobin Dunn <robin@alldunn.com>
Wed, 5 Jul 2006 00:37:11 +0000 (00:37 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 5 Jul 2006 00:37:11 +0000 (00:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/b
wxPython/b.win32
wxPython/include/wx/wxPython/wxPython_int.h
wxPython/src/_bitmap.i
wxPython/src/helpers.cpp

index 51cf5d683fcb482014ced29666a81ab1165f0f2a..78c8654efe031147b5020d3e11519f2416a51505 100755 (executable)
@@ -25,6 +25,8 @@ function getpyver {
        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
index bf29a2ff5f29d933ac6b6da99c918e39191a04c4..5f4908879b26ed6e8d4f489629e87094ecb718f2 100644 (file)
@@ -12,6 +12,7 @@ case $1 in
     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
index dac352d95dca9a06566db4d6132f2077e9df62fb..514be3c08a2f3a9487a42466117a29351828334a 100644 (file)
@@ -186,6 +186,13 @@ typedef PyGILState_STATE wxPyBlock_t;
 #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++
index bd0600d824ed4b9e2ba683e7b831e6b7e9e9b669..93fa2a2b9320fe80e44cdccd0f6f4748cffb4371 100644 (file)
@@ -150,8 +150,8 @@ bit depths, the behaviour is platform dependent.", "");
         
         %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);
         }
index 470815f2675ac4aedf2da3d0b83f61155742648f..0ef3c132492922290592ddd551e06f08ccf53d22 100644 (file)
@@ -1878,7 +1878,7 @@ wxString* wxString_in_helper(PyObject* source) {
         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);
 
@@ -1921,7 +1921,7 @@ wxString Py2wxString(PyObject* source)
         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);