build: support newlines in syscall decls

Some auto formatters will wrap long lines of code and insert newlines
that are part of function decls outside of arguments. This change strips
out all newlines so syscall typename regex function as expected.

Signed-off-by: Mark Inderhees <markind@meta.com>
This commit is contained in:
Mark Inderhees 2024-11-08 17:12:09 -08:00 committed by Anas Nashif
parent 70abb6077d
commit 1993ea019b
1 changed files with 2 additions and 1 deletions

View File

@ -184,6 +184,7 @@ class SyscallParseException(Exception):
def typename_split(item):
item = item.strip().replace("\n", " ")
if "[" in item:
raise SyscallParseException(
"Please pass arrays to syscalls as pointers, unable to process '%s'" %
@ -396,7 +397,7 @@ def analyze_fn(match_group, fn, userspace_only):
if args == "void":
args = []
else:
args = [typename_split(a.strip()) for a in args.split(",")]
args = [typename_split(a) for a in args.split(",")]
func_type, func_name = typename_split(func)
except SyscallParseException: