proto: make proto doesn't handle bool type correctly

closes: #19436

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Hirohito Higashi
2026-02-16 22:20:50 +00:00
committed by Christian Brabandt
parent 9ebb666b8c
commit 823f4f12b8
+3
View File
@@ -441,6 +441,9 @@ def generate_prototypes(tu, src_path: Path) -> List[str]:
print(f"[def] {fn.spelling}", file=sys.stderr)
toks = tokens_for_function_header(fn)
header = join_tokens(toks) if toks else header_from_cursor(fn)
# libclang expands the bool macro (from <stdbool.h>) to _Bool.
# Restore it to bool for readability.
header = re.sub(r'\b_Bool\b', 'bool', header)
if header:
protos.append(f"{header};")