Skip to content

Commit

Permalink
scripts: fix regexp for poll stuff
Browse files Browse the repository at this point in the history
Support for zephyr in tpm2-tss broke the removal of poll conditionals.
So make the matching more flexible.

Signed-off-by: Erik Larsson <[email protected]>
  • Loading branch information
whooo committed Feb 3, 2025
1 parent e35ba5d commit a0b2a5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/prepare_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def remove_common_guards(s):

def remove_poll_stuff(s, poll_handle_type):

r = r"#if defined\(__linux__\) \|\| defined\(__unix__\) \|\| defined\(__APPLE__\) \|\| defined \(__QNXNTO__\) \|\| defined \(__VXWORKS__\)(\n.*)+#endif\n#endif"
r = r"#if defined\(__linux__\).*(\n.*)+#endif\n#endif"

s = re.sub(r, f"typedef struct pollfd {poll_handle_type};", s)
return s
Expand Down

0 comments on commit a0b2a5b

Please sign in to comment.