Skip to contentSkip to conversation

buildtools/cmdline-gen: add more headers to generated file

PATCH Applied Bruce Richardson 2 participants 2 messages Apr 30 – May 18

lore
Share & tools
lore
#0 lore raw

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
index 7dadded783..d87adcfca9 100755
@@ -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
#1 lore raw

30/04/2026 13:30, Bruce Richardson:

Quoted 5 lines

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.

Quoted 7 lines

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.

Applied, thanks.