Browse Source

build on python 2.4

David Rose 16 years ago
parent
commit
30b413df8b
2 changed files with 7 additions and 1 deletions
  1. 0 1
      direct/src/plugin/p3dCInstance.h
  2. 7 0
      direct/src/plugin/p3dPythonRun.h

+ 0 - 1
direct/src/plugin/p3dCInstance.h

@@ -21,7 +21,6 @@
 #include "pvector.h"
 
 #include <Python.h>
-#define TIXML_USE_STL
 #include <tinyxml.h>
 
 class P3DSession;

+ 7 - 0
direct/src/plugin/p3dPythonRun.h

@@ -32,6 +32,13 @@
 #include <Python.h>
 #include <tinyxml.h>
 
+// Python 2.5 adds Py_ssize_t; earlier versions don't have it.
+#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
+
 using namespace std;
 
 ////////////////////////////////////////////////////////////////////