[GRASS-SVN] r38899 - grass/branches/develbranch_6/swig/include/python

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 28 09:38:28 EDT 2009


Author: martinl
Date: 2009-08-28 09:38:28 -0400 (Fri, 28 Aug 2009)
New Revision: 38899

Modified:
   grass/branches/develbranch_6/swig/include/python/common.i
Log:
glynn: Define Py_ssize_t for Python < 2.5
       (merge from trunk, r38892)


Modified: grass/branches/develbranch_6/swig/include/python/common.i
===================================================================
--- grass/branches/develbranch_6/swig/include/python/common.i	2009-08-28 09:00:23 UTC (rev 38898)
+++ grass/branches/develbranch_6/swig/include/python/common.i	2009-08-28 13:38:28 UTC (rev 38899)
@@ -1,6 +1,13 @@
 %{
 #include <stdio.h>
 #include <grass/gis.h>
+
+#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
+
 %}
 
 %rename(my_def) def;



More information about the grass-commit mailing list