Skip to content

Commit

Permalink
tools: ynl-gen: add extra headers for user space
Browse files Browse the repository at this point in the history
Make sure all relevant headers are included, we allocate memory,
use memcpy() and Linux types without including the headers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Jun 3, 2023
1 parent 3f06760 commit 91dfaef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/net/ynl/ynl-gen-c.py
Original file line number Diff line number Diff line change
Expand Up @@ -2103,6 +2103,13 @@ def main():
cw.nl()
headers = ['uapi/' + parsed.uapi_header]
else:
cw.p('#include <stdlib.h>')
if args.header:
cw.p('#include <string.h>')
cw.p('#include <linux/types.h>')
else:
cw.p(f'#include "{parsed.name}-user.h"')
cw.p('#include "ynl.h"')
headers = [parsed.uapi_header]
for definition in parsed['definitions']:
if 'header' in definition:
Expand Down

0 comments on commit 91dfaef

Please sign in to comment.