From 126e0038a73b38fac7b3e03173b2d791734cc497 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Tue, 15 Dec 2015 23:09:15 +0200 Subject: trafgen: Added option to pass macro/define for C preprocessor Add -D,--define option which allows to pass multiple macro/defines which can be used in trafgen script (e.g. by #ifdef ). Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- trafgen_parser.y | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'trafgen_parser.y') diff --git a/trafgen_parser.y b/trafgen_parser.y index 8a0f3b7..24370ee 100644 --- a/trafgen_parser.y +++ b/trafgen_parser.y @@ -590,7 +590,8 @@ void cleanup_packets(void) free(packet_dyn); } -void compile_packets(char *file, bool verbose, unsigned int cpu, bool invoke_cpp) +void compile_packets(char *file, bool verbose, unsigned int cpu, bool invoke_cpp, + char **cpp_argv) { char tmp_file[128]; int ret = -1; @@ -599,7 +600,7 @@ void compile_packets(char *file, bool verbose, unsigned int cpu, bool invoke_cpp our_cpu = cpu; if (invoke_cpp) { - if (cpp_exec(file, tmp_file, sizeof(tmp_file), NULL)) { + if (cpp_exec(file, tmp_file, sizeof(tmp_file), cpp_argv)) { fprintf(stderr, "Failed to invoke C preprocessor!\n"); goto err; } -- cgit v1.2.3-54-g00ecf