[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pypy-svn
Subject:    [pypy-svn] r73222 - pypy/branch/cpython-extension/pypy/module/cpyext
From:       xoraxax () codespeak ! net
Date:       2010-03-31 16:04:46
Message-ID: 20100331160446.61E19282BD8 () codespeak ! net
[Download RAW message or body]

Author: xoraxax
Date: Wed Mar 31 18:04:44 2010
New Revision: 73222

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/api.py
Log:
Introduce FUNCTIONS_STATIC, this is necessary for a hack.

Modified: pypy/branch/cpython-extension/pypy/module/cpyext/api.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/api.py	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/api.py	Wed Mar 31 18:04:44 2010
@@ -9,7 +9,6 @@
 from pypy.rpython.lltypesystem import ll2ctypes
 from pypy.rpython.annlowlevel import llhelper
 from pypy.rlib.objectmodel import we_are_translated
-from pypy.translator.c.database import LowLevelDatabase
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.tool.udir import udir
 from pypy.translator import platform
@@ -190,6 +189,8 @@
         unwrapper_raise = make_unwrapper(False)
         if external:
             FUNCTIONS[func.func_name] = api_function
+        else:
+            FUNCTIONS_STATIC[func.func_name] = api_function
         INTERPLEVEL_API[func.func_name] = unwrapper_catch # used in tests
         return unwrapper_raise # used in 'normal' RPython code.
     return decorate
@@ -209,6 +210,7 @@
 
 INTERPLEVEL_API = {}
 FUNCTIONS = {}
+FUNCTIONS_STATIC = {}
 FUNCTIONS_C = {}
 TYPES = {}
 GLOBALS = {
@@ -346,6 +348,7 @@
     from pypy.module.cpyext.pyobject import make_ref
 
     export_symbols = list(FUNCTIONS) + list(FUNCTIONS_C) + list(GLOBALS)
+    from pypy.translator.c.database import LowLevelDatabase
     db = LowLevelDatabase()
 
     generate_macros(export_symbols, rename)
@@ -494,6 +497,7 @@
     from pypy.module.cpyext.pyobject import make_ref
 
     export_symbols = list(FUNCTIONS) + list(FUNCTIONS_C) + list(GLOBALS)
+    from pypy.translator.c.database import LowLevelDatabase
     db = LowLevelDatabase()
 
     generate_macros(export_symbols, rename, False)
@@ -518,6 +522,8 @@
     for name, func in FUNCTIONS.iteritems():
         deco = entrypoint("cpyext", func.argtypes, name, relax=True)
         deco(func.get_wrapper(space))
+    for name, func in FUNCTIONS_STATIC.iteritems():
+        func.get_wrapper(space).c_name = name
 
 
 @unwrap_spec(ObjSpace, str, str)
_______________________________________________
pypy-svn mailing list
pypy-svn@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-svn
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic