[pypy-svn] r73285 - in pypy/branch/cpython-extension/pypy/module/cpyext: . include
afa at codespeak.net
afa at codespeak.net
Fri Apr 2 11:12:35 CEST 2010
Author: afa
Date: Fri Apr 2 11:12:34 2010
New Revision: 73285
Modified:
pypy/branch/cpython-extension/pypy/module/cpyext/api.py
pypy/branch/cpython-extension/pypy/module/cpyext/include/structmember.h
Log:
Fix tests on Windows
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 Fri Apr 2 11:12:34 2010
@@ -410,7 +410,7 @@
struct PyPyAPI* pypyAPI = &_pypyAPI;
""" % dict(members=structmembers)
- functions = generate_decls_and_callbacks(db)
+ functions = generate_decls_and_callbacks(db, export_symbols)
global_objects = []
for name, (type, expr) in GLOBALS.iteritems():
@@ -484,7 +484,7 @@
pypy_macros_h = udir.join('pypy_macros.h')
pypy_macros_h.write('\n'.join(pypy_macros))
-def generate_decls_and_callbacks(db):
+def generate_decls_and_callbacks(db, export_symbols):
# implement function callbacks and generate function decls
functions = []
pypy_decls = []
@@ -510,6 +510,8 @@
(name, name_no_star))
pypy_decls.append(header + ';')
functions.append(header + '\n{return va_arg(*vp, %s);}\n' % name)
+ if not we_are_translated():
+ export_symbols.append('pypy_va_get_%s' % (name_no_star,))
pypy_decls.append("#endif\n")
Modified: pypy/branch/cpython-extension/pypy/module/cpyext/include/structmember.h
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/include/structmember.h (original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/include/structmember.h Fri Apr 2 11:12:34 2010
@@ -5,6 +5,11 @@
#endif
+#ifndef offsetof
+#define offsetof(type, member) ( (int) & ((type*)0) -> member )
+#endif
+
+
typedef struct PyMemberDef {
/* Current version, use this */
char *name;
More information about the Pypy-commit
mailing list