[pypy-svn] r61560 - pypy/trunk/pypy/rpython/lltypesystem/test
afa at codespeak.net
afa at codespeak.net
Thu Feb 5 15:07:07 CET 2009
Author: afa
Date: Thu Feb 5 15:07:06 2009
New Revision: 61560
Modified:
pypy/trunk/pypy/rpython/lltypesystem/test/test_rffi.py
Log:
It is necessary to declare a function when its return value is a pointer, for platforms where sizeof(void*) > sizeof(int)
Otherwise the returned value is truncated to an int and boom.
Modified: pypy/trunk/pypy/rpython/lltypesystem/test/test_rffi.py
==============================================================================
--- pypy/trunk/pypy/rpython/lltypesystem/test/test_rffi.py (original)
+++ pypy/trunk/pypy/rpython/lltypesystem/test/test_rffi.py Thu Feb 5 15:07:06 2009
@@ -75,7 +75,7 @@
#include <string.h>
#include <Python.h>
#include <src/mem.h>
-
+
char *f(char* arg)
{
char *ret;
@@ -87,7 +87,8 @@
return ret;
}
""")
- eci = ExternalCompilationInfo(separate_module_sources=[c_source])
+ eci = ExternalCompilationInfo(separate_module_sources=[c_source],
+ post_include_bits=['char *f(char*);'])
z = llexternal('f', [CCHARP], CCHARP, compilation_info=eci)
def f():
More information about the Pypy-commit
mailing list