This commit is contained in:
richard 2022-10-18 10:33:37 +01:00
parent 2c233d47fa
commit 81590eb815

View file

@ -53,6 +53,8 @@ def makefunc(a):
arg = ffi.new("int *", arg)
elif type(arg) is float:
arg = ffi.new("float *", arg)
elif type(arg) is list and str(c_arg) == "<ctype 'char * *'>":
arg = [ffi.new("char[]", x.encode('utf-8')) for x in arg]
elif str(type(arg)) == "<class '_cffi_backend.__CDataOwn'>" and "*" not in str(arg): # CPython
arg = ffi.addressof(arg)
elif str(type(arg)) == "<class '_cffi_backend._CDataBase'>" and "*" not in str(arg): # Pypy