From bdd2a4913eaa0f1d3721979058b53e181832cfa8 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 18 Mar 2022 08:07:49 -0700 Subject: Fix missing: pass -I to preprocessor. --- cppawk | 2 +- testcases | 14 ++++++++++++++ testdir/header.cwh | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 testdir/header.cwh diff --git a/cppawk b/cppawk index 6d56295..9a74cbf 100755 --- a/cppawk +++ b/cppawk @@ -77,7 +77,7 @@ while [ $# -gt 0 ] ; do -M?* ) die "-M family of cpp options not supported" ;; - -U* | -D* | -iquote* ) + -U* | -D* | -I* | -iquote* ) prepro_opts="$prepro_opts $(shell_escape "$1")" ;; -f ) diff --git a/testcases b/testcases index 5aed49e..1c2e6c8 100644 --- a/testcases +++ b/testcases @@ -69,3 +69,17 @@ ERR 1 1 2 +-- +14: +./cppawk -Itestdir ' +#include "header.cwh" +BEGIN { print max(42, 73) }' +: +73 +-- +15: +./cppawk -iquotetestdir ' +#include "header.cwh" +BEGIN { print max(42, 73) }' +: +73 diff --git a/testdir/header.cwh b/testdir/header.cwh new file mode 100644 index 0000000..73873ef --- /dev/null +++ b/testdir/header.cwh @@ -0,0 +1,2 @@ +/* cppawk header file */ +#define max(a, b) ((a) > (b) ? (a) : (b)) -- cgit v1.2.3