[pypy-svn] r73375 - pypy/branch/cpython-extension/pypy/module/cpyext/include

xoraxax at codespeak.net xoraxax at codespeak.net
Sun Apr 4 19:52:46 CEST 2010


Author: xoraxax
Date: Sun Apr  4 19:52:44 2010
New Revision: 73375

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/include/Python.h
   pypy/branch/cpython-extension/pypy/module/cpyext/include/object.h
   pypy/branch/cpython-extension/pypy/module/cpyext/include/tupleobject.h
Log:
Add macro and a define for PyTuple_GET_ITEM.

Modified: pypy/branch/cpython-extension/pypy/module/cpyext/include/Python.h
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/include/Python.h	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/include/Python.h	Sun Apr  4 19:52:44 2010
@@ -9,6 +9,7 @@
 #define PY_LONG_LONG long long
 #define SIZEOF_LONG_LONG sizeof(PY_LONG_LONG)
 #define PY_FORMAT_SIZE_T "z"
+#define SIZEOF_VOID_P sizeof(void *)
 #define WITH_DOC_STRINGS
 
 /* Compat stuff */

Modified: pypy/branch/cpython-extension/pypy/module/cpyext/include/object.h
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/include/object.h	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/include/object.h	Sun Apr  4 19:52:44 2010
@@ -396,6 +396,14 @@
 #define PyObject_NewVar(type, typeobj, n) \
 		( (type *) _PyObject_NewVar((typeobj), (n)) )
 
+#define _PyObject_VAR_SIZE(typeobj, nitems)	\
+	(size_t)				\
+	( ( (typeobj)->tp_basicsize +		\
+	    (nitems)*(typeobj)->tp_itemsize +	\
+	    (SIZEOF_VOID_P - 1)			\
+	  ) & ~(SIZEOF_VOID_P - 1)		\
+	)
+
 #define PyObject_INIT(op, typeobj) \
 	( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
 #define PyObject_INIT_VAR(op, typeobj, size) \

Modified: pypy/branch/cpython-extension/pypy/module/cpyext/include/tupleobject.h
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/include/tupleobject.h	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/include/tupleobject.h	Sun Apr  4 19:52:44 2010
@@ -11,6 +11,8 @@
 PyObject * PyTuple_Pack(Py_ssize_t, ...);
 
 #define PyTuple_SET_ITEM PyTuple_SetItem
+#define PyTuple_GET_ITEM PyTuple_GetItem
+
 
 #ifdef __cplusplus
 }



More information about the Pypy-commit mailing list