Explorar el Código

Update bindings.h

blueloveTH hace 1 año
padre
commit
b8769aa560
Se han modificado 1 ficheros con 10 adiciones y 0 borrados
  1. 10 0
      include/pocketpy/bindings.h

+ 10 - 0
include/pocketpy/bindings.h

@@ -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,               \