aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-03-18 08:07:49 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-03-18 08:07:49 -0700
commitbdd2a4913eaa0f1d3721979058b53e181832cfa8 (patch)
tree4352e0dda211a865b3dc8d60e1a31256486b3f5d
parente8773eaa71ecbe1a44f8d88583735c596dbfd99e (diff)
downloadcppawk-bdd2a4913eaa0f1d3721979058b53e181832cfa8.tar.gz
cppawk-bdd2a4913eaa0f1d3721979058b53e181832cfa8.tar.bz2
cppawk-bdd2a4913eaa0f1d3721979058b53e181832cfa8.zip
Fix missing: pass -I to preprocessor.
-rwxr-xr-xcppawk2
-rw-r--r--testcases14
-rw-r--r--testdir/header.cwh2
3 files changed, 17 insertions, 1 deletions
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))