[pypy-svn] r73551 - pypy/branch/cpython-extension/pypy/module/cpyext/include
jandem at codespeak.net
jandem at codespeak.net
Thu Apr 8 16:15:36 CEST 2010
Author: jandem
Date: Thu Apr 8 16:15:35 2010
New Revision: 73551
Added:
pypy/branch/cpython-extension/pypy/module/cpyext/include/pyport.h
pypy/branch/cpython-extension/pypy/module/cpyext/include/sliceobject.h
Modified:
pypy/branch/cpython-extension/pypy/module/cpyext/include/Python.h
pypy/branch/cpython-extension/pypy/module/cpyext/include/object.h
Log:
add sliceobject.h, pyport.h and a few macros
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 Thu Apr 8 16:15:35 2010
@@ -74,6 +74,7 @@
#include "patchlevel.h"
#include "object.h"
+#include "pyport.h"
#include <stdarg.h>
#include <stdio.h>
@@ -100,6 +101,8 @@
#include "eval.h"
#include "pymem.h"
#include "pycobject.h"
+#include "bufferobject.h"
+#include "sliceobject.h"
// XXX This shouldn't be included here
#include "structmember.h"
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 Thu Apr 8 16:15:35 2010
@@ -388,7 +388,9 @@
#define Py_TPFLAGS_DEFAULT Py_TPFLAGS_DEFAULT_EXTERNAL
+#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
+#define _Py_NewReference(op) (Py_REFCNT(op) = 1)
/* objimpl.h ----------------------------------------------*/
#define PyObject_DEL PyObject_Del
Added: pypy/branch/cpython-extension/pypy/module/cpyext/include/pyport.h
==============================================================================
--- (empty file)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/include/pyport.h Thu Apr 8 16:15:35 2010
@@ -0,0 +1,19 @@
+#ifndef Py_PYPORT_H
+#define Py_PYPORT_H
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+/* Largest possible value of size_t.
+ SIZE_MAX is part of C99, so it might be defined on some
+ platforms. If it is not defined, (size_t)-1 is a portable
+ definition for C89, due to the way signed->unsigned
+ conversion is defined. */
+#ifdef SIZE_MAX
+#define PY_SIZE_MAX SIZE_MAX
+#else
+#define PY_SIZE_MAX ((size_t)-1)
+#endif
+
+#endif /* Py_PYPORT_H */
Added: pypy/branch/cpython-extension/pypy/module/cpyext/include/sliceobject.h
==============================================================================
--- (empty file)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/include/sliceobject.h Thu Apr 8 16:15:35 2010
@@ -0,0 +1,20 @@
+#ifndef Py_SLICEOBJECT_H
+#define Py_SLICEOBJECT_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* The unique ellipsis object "..." */
+
+PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */
+
+#define Py_Ellipsis (&_Py_EllipsisObject)
+
+typedef struct {
+ PyObject_HEAD
+} PySliceObject;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !Py_SLICEOBJECT_H */
More information about the Pypy-commit
mailing list