Author: Ronan Lamy <[email protected]>
Branch: multiphase
Changeset: r91596:527c72b5b5d9
Date: 2017-06-12 21:23 +0100
http://bitbucket.org/pypy/pypy/changeset/527c72b5b5d9/
Log: Add result_is_ll option to cts.decl()
diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -487,13 +487,15 @@
return decorate
def api_func_from_cdef(func, cdef, cts,
- error=_NOT_SPECIFIED, header=DEFAULT_HEADER):
+ error=_NOT_SPECIFIED, header=DEFAULT_HEADER,
+ result_is_ll=False):
func._always_inline_ = 'try'
cdecl = cts.parse_func(cdef)
RESULT = cdecl.get_llresult(cts)
api_function = ApiFunction(
cdecl.get_llargs(cts), RESULT, func,
- error=_compute_error(error, RESULT), cdecl=cdecl)
+ error=_compute_error(error, RESULT), cdecl=cdecl,
+ result_is_ll=result_is_ll)
FUNCTIONS_BY_HEADER[header][cdecl.name] = api_function
unwrapper = api_function.get_unwrapper()
unwrapper.func = func
@@ -698,10 +700,12 @@
class CpyextTypeSpace(CTypeSpace):
- def decl(self, cdef, error=_NOT_SPECIFIED, header=DEFAULT_HEADER):
+ def decl(self, cdef, error=_NOT_SPECIFIED, header=DEFAULT_HEADER,
+ result_is_ll=False):
def decorate(func):
return api_func_from_cdef(
- func, cdef, self, error=error, header=header)
+ func, cdef, self, error=error, header=header,
+ result_is_ll=result_is_ll)
return decorate
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit