[pypy-svn] r72544 - in pypy/trunk/pypy/module/cpyext: . include

afa at codespeak.net afa at codespeak.net
Mon Mar 22 13:54:25 CET 2010


Author: afa
Date: Mon Mar 22 13:54:23 2010
New Revision: 72544

Modified:
   pypy/trunk/pypy/module/cpyext/api.py
   pypy/trunk/pypy/module/cpyext/include/Python.h
Log:
Let the configure() work


Modified: pypy/trunk/pypy/module/cpyext/api.py
==============================================================================
--- pypy/trunk/pypy/module/cpyext/api.py	(original)
+++ pypy/trunk/pypy/module/cpyext/api.py	Mon Mar 22 13:54:23 2010
@@ -14,6 +14,7 @@
 from pypy.translator import platform
 from pypy.module.cpyext.state import State
 from pypy.interpreter.error import OperationError
+from pypy.interpreter.gateway import ObjSpace, unwrap_spec
 
 
 Py_ssize_t = lltype.Signed
@@ -33,17 +34,13 @@
 class CConfig_constants:
     _compilation_info_ = CConfig._compilation_info_
 
-constant_names = """Py_TPFLAGS_READY Py_TPFLAGS_READYING """.split()
+constant_names = """
+Py_TPFLAGS_READY Py_TPFLAGS_READYING
+METH_COEXIST METH_STATIC METH_CLASS METH_NOARGS
+""".split()
 for name in constant_names:
     setattr(CConfig_constants, name, rffi_platform.ConstantInteger(name))
-# XXX does not work, why?
-#globals().update(rffi_platform.configure(CConfig_constants))
-Py_TPFLAGS_READY = (1L<<12)
-Py_TPFLAGS_READYING = (1L<<13)
-METH_COEXIST = 0x0040
-METH_STATIC = 0x0020
-METH_CLASS = 0x0010
-METH_NOARGS = 0x0004
+globals().update(rffi_platform.configure(CConfig_constants))
 
 
 class ApiFunction:
@@ -191,6 +188,7 @@
 
     prologue = """\
     #define const            /* cheat */
+    #include <pypy_rename.h>
     #include <Python.h>
     """
     pypy_rename = []

Modified: pypy/trunk/pypy/module/cpyext/include/Python.h
==============================================================================
--- pypy/trunk/pypy/module/cpyext/include/Python.h	(original)
+++ pypy/trunk/pypy/module/cpyext/include/Python.h	Mon Mar 22 13:54:23 2010
@@ -1,7 +1,6 @@
 #ifndef Py_PYTHON_H
 #define Py_PYTHON_H
 
-#include <pypy_rename.h>
 /* Compat stuff */
 #ifndef _WIN32
 # include <inttypes.h>



More information about the Pypy-commit mailing list