For callable docstrings allow either std::function or Callback typedef

This commit is contained in:
baldurk
2026-02-12 14:21:08 +00:00
parent 109e524d5c
commit 1730e6b5af
+2 -2
View File
@@ -100,8 +100,8 @@ def make_c_type(ret: str, pattern: bool, typelist: List[str]):
ret = 'rdcstrpairs'
elif ret == 'Tuple[str,str]': # special case
ret = 'rdcstrpair'
elif ret == 'Callable[[], None]': # callbacks with parameters or return type should have a *Callback typedef
ret = 'std::function<void\(\)>' if pattern else 'std::function'
elif ret[0:9] == 'Callable[':
ret = '(std::function<void\(\)>|[A-Za-z_]+Callback)' if pattern else 'std::function/NamedCallback'
elif ret[0:5] == 'List[':
inner = make_c_type(ret[5:-1], pattern, typelist)
ret = '(const )?rdcarray<{}> ?[&*]?'.format(inner) if pattern else 'rdcarray<{}>'.format(inner)