buildtools/cmdline-gen: add more headers to generated file
PATCH 1/1 buildtools/cmdline-gen: add more headers to generated file
The generated cmdline header file output often uses uintXX_t types for parameters specified in the input file. Therefore include stdint.h so that the types are available for uses of the generated file without requiring the user to include the header in their C file.
Although not strictly required, also include cmdline_socket.h too, to provide the "cmdline_stdin_new()" function. The standard cmdline.h only provides the more generic "cmdline_new()" function, which is less useful for many cases. Therefore, having the extra header include just makes things a little easier on the end-user.
--- buildtools/dpdk-cmdline-gen.py | 3 +++ 1 file changed, 3 insertions(+)
buildtools/dpdk-cmdline-gen.py +3 -0
@@ -143,8 +143,11 @@ def process_commands(infile, hfile, cfile, ctxname): /* File autogenerated by {sys.argv[0]} */ #ifndef GENERATED_COMMANDS_H #define GENERATED_COMMANDS_H + +#include <stdint.h> #include <rte_common.h> #include <cmdline.h> +#include <cmdline_socket.h> #include <cmdline_parse_string.h> #include <cmdline_parse_num.h> #include <cmdline_parse_ipaddr.h>
Signature · 1 line
2.51.0
Thomas Monjalon
Applied30/04/2026 13:30, Bruce Richardson:
Quoted 5 lines
The generated cmdline header file output often uses
uintXX_ttypes for parameters specified in the input file. Therefore includestdint.hso that the types are available for uses of the generated file without requiring the user to include the header in their C file.
Quoted 7 lines
Although not strictly required, also include
cmdline_socket.htoo, to provide the "cmdline_stdin_new()" function. The standardcmdline.honly provides the more generic "cmdline_new()" function, which is less useful for many cases. Therefore, having the extra header include just makes things a little easier on the end-user.Signed-off-by Bruce Richardson <[email protected]>
Applied, thanks.