py/makemoduledefs.py: Automatically declare delegation attr functions.
So that the delegation functions don't need to be put somewhere global, like in mpconfigport.h. That would otherwise make it hard for extension modules to use delegation. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -106,7 +106,10 @@ def generate_module_delegations(delegations):
|
||||
if not delegations:
|
||||
return
|
||||
|
||||
print("\n#define MICROPY_MODULE_DELEGATIONS \\")
|
||||
print()
|
||||
for obj_module, fun_name in delegations:
|
||||
print("extern void {}(mp_obj_t self_in, qstr attr, mp_obj_t *dest);".format(fun_name))
|
||||
print("#define MICROPY_MODULE_DELEGATIONS \\")
|
||||
for obj_module, fun_name in delegations:
|
||||
print(
|
||||
" {{ MP_ROM_PTR(&{obj_module}), {fun_name} }}, \\".format(
|
||||
|
||||
Reference in New Issue
Block a user