Update bindings.h

This commit is contained in:
blueloveTH 2024-05-04 21:53:11 +08:00
parent 37c28e0061
commit b8769aa560

View File

@ -114,6 +114,16 @@ PyObject* VM::bind_field(PyObject* obj, const char* name, F T::*field){
obj->attr().set(StrName(name_sv), prop); obj->attr().set(StrName(name_sv), prop);
return prop; return prop;
} }
template<typename Ret, typename... Params>
[[deprecated]] void _bind(VM* vm, PyObject* obj, const char* sig, Ret(*func)(Params...)){
return vm->bind(obj, sig, func);
}
template<typename Ret, typename T, typename... Params>
[[deprecated]] void _bind(VM* vm, PyObject* obj, const char* sig, Ret(T::*func)(Params...)){
return vm->bind(obj, sig, func);
}
/*****************************************************************/ /*****************************************************************/
#define PY_FIELD(T, NAME, EXPR) \ #define PY_FIELD(T, NAME, EXPR) \
vm->bind_property(type, NAME, \ vm->bind_property(type, NAME, \