Skip to content

Commit c220726

Browse files
eivindj-nordicrlubos
authored andcommitted
scripts: unity: header_prepare: Rewrite SVCALL to normal function
Rewrite SVCALL to normal function declaration. Signed-off-by: Eivind Jølsgard <[email protected]>
1 parent b84a601 commit c220726

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/unity/header_prepare.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ def header_prepare(in_file, out_file, out_wrap_file):
3535
re.M | re.S)
3636
content = static_inline_pattern.sub(r"", content)
3737

38+
# rewrite SVCALL to normal function declaration
39+
svcall_pattern = re.compile(
40+
r'SVCALL\(\w+, (\w+), (\w+\([^)]*\))\);',
41+
re.M)
42+
content = svcall_pattern.sub(r"\1 \2;", content)
43+
3844
# change static inline functions to normal function declaration
3945
static_inline_pattern = re.compile(
4046
r'(?:__deprecated\s+)?(?:static\s+inline\s+|inline\s+static\s+|static\s+ALWAYS_INLINE\s+|__STATIC_INLINE\s+)'

0 commit comments

Comments
 (0)