summaryrefslogtreecommitdiff
path: root/trafgen_parser.y
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2015-12-15 23:09:15 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-12-17 10:55:58 +0100
commit126e0038a73b38fac7b3e03173b2d791734cc497 (patch)
tree4ec36f3ba75e1ef4111134c1fc4afc1e8566dd66 /trafgen_parser.y
parent121119215276e645b358d7ce0593251f215920df (diff)
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 <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_parser.y')
-rw-r--r--trafgen_parser.y5
1 files changed, 3 insertions, 2 deletions
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;
}