Commits

Anonymous committed 3b6846c

python3: more port changes in the GSoC project and added #if (PY_VERSION_HEX < 0x03010000) code switches. Now rinterface.c and rpy_rinterface.h should be done.

  • Participants
  • Parent commits b025823

Comments (0)

Files changed (1)

 
 diff -r 089949fdede1 rpy/rinterface/rinterface.c
 --- a/rpy/rinterface/rinterface.c	Sun Jun 27 09:47:32 2010 +0200
-+++ b/rpy/rinterface/rinterface.c	Sat Jul 17 23:17:54 2010 +0200
++++ b/rpy/rinterface/rinterface.c	Sat Jul 17 23:29:14 2010 +0200
 @@ -473,7 +473,11 @@
      return 0;
    }
 -
 +  return m;
  }
+diff -r 089949fdede1 rpy/rinterface/rpy_rinterface.h
+--- a/rpy/rinterface/rpy_rinterface.h	Sun Jun 27 09:47:32 2010 +0200
++++ b/rpy/rinterface/rpy_rinterface.h	Sat Jul 17 23:29:14 2010 +0200
+@@ -104,9 +104,17 @@
+     LOGICAL_POINTER(sexp)[0] = py_obj == Py_True ? TRUE : FALSE;        \
+     PROTECT(sexp);                                                      \
+     protect_count++;                                                    \
+-  } else if (PyInt_Check(py_obj)) {                                     \
++    #if (PY_VERSION_HEX < 0x03010000)					\
++ } else if (PyInt_Check(py_obj)) {					\
++    #else								\
++ } else if (PyLong_Check(py_obj)) {				\
++    #endif								\
+     sexp = allocVector(INTSXP, 1);                                      \
++    #if (PY_VERSION_HEX < 0x03010000)					\
+     INTEGER_POINTER(sexp)[0] = (int)(PyInt_AS_LONG(py_obj));            \
++    #else								\
++      INTEGER_POINTER(sexp)[0] = (int)(PyLong_AS_LONG(py_obj));		\
++    #endif								\
+     PROTECT(sexp);                                                      \
+     protect_count++;                                                    \
+   } else if (PyLong_Check(py_obj)) {                                    \