mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 12:00:18 +00:00
some fix
This commit is contained in:
parent
c7495853ec
commit
1227667735
@ -1344,7 +1344,7 @@ void VM::bind__delitem__(Type type, void (*f)(VM*, PyObject*, PyObject*)){
|
|||||||
#define BIND_UNARY_SPECIAL(name) \
|
#define BIND_UNARY_SPECIAL(name) \
|
||||||
void VM::bind##name(Type type, PyObject* (*f)(VM*, PyObject*)){ \
|
void VM::bind##name(Type type, PyObject* (*f)(VM*, PyObject*)){ \
|
||||||
_all_types[type].m##name = f; \
|
_all_types[type].m##name = f; \
|
||||||
PyObject* nf = bind_method<0>(_t(type), #name, [](VM* vm, ArgsView args){ \
|
PyObject* nf = bind_method<0>(_t(type), name, [](VM* vm, ArgsView args){ \
|
||||||
return lambda_get_userdata<PyObject*(*)(VM*, PyObject*)>(args.begin())(vm, args[0]);\
|
return lambda_get_userdata<PyObject*(*)(VM*, PyObject*)>(args.begin())(vm, args[0]);\
|
||||||
}); \
|
}); \
|
||||||
PK_OBJ_GET(NativeFunc, nf).set_userdata(f); \
|
PK_OBJ_GET(NativeFunc, nf).set_userdata(f); \
|
||||||
@ -1381,7 +1381,7 @@ void VM::bind__len__(Type type, i64 (*f)(VM*, PyObject*)){
|
|||||||
#define BIND_BINARY_SPECIAL(name) \
|
#define BIND_BINARY_SPECIAL(name) \
|
||||||
void VM::bind##name(Type type, BinaryFuncC f){ \
|
void VM::bind##name(Type type, BinaryFuncC f){ \
|
||||||
_all_types[type].m##name = f; \
|
_all_types[type].m##name = f; \
|
||||||
PyObject* nf = bind_method<1>(type, #name, [](VM* vm, ArgsView args){ \
|
PyObject* nf = bind_method<1>(type, name, [](VM* vm, ArgsView args){ \
|
||||||
return lambda_get_userdata<BinaryFuncC>(args.begin())(vm, args[0], args[1]);\
|
return lambda_get_userdata<BinaryFuncC>(args.begin())(vm, args[0], args[1]);\
|
||||||
}); \
|
}); \
|
||||||
PK_OBJ_GET(NativeFunc, nf).set_userdata(f); \
|
PK_OBJ_GET(NativeFunc, nf).set_userdata(f); \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user