aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-03-18 08:18:32 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-03-18 08:18:32 -0700
commitce81c2bd9ce70ee73c4d6a4a253ae9d08fdccae7 (patch)
tree0c59150a7d9b902ec1482c150c3e7f7572ce25ae
parent59119adedce9405ce320d4609885f734d0aae5c5 (diff)
downloadcppawk-ce81c2bd9ce70ee73c4d6a4a253ae9d08fdccae7.tar.gz
cppawk-ce81c2bd9ce70ee73c4d6a4a253ae9d08fdccae7.tar.bz2
cppawk-ce81c2bd9ce70ee73c4d6a4a253ae9d08fdccae7.zip
Define __bignum__ if -M or --bignum option used.
-rwxr-xr-xcppawk4
-rw-r--r--testcases9
2 files changed, 13 insertions, 0 deletions
diff --git a/cppawk b/cppawk
index d24300b..cdfe9f1 100755
--- a/cppawk
+++ b/cppawk
@@ -94,6 +94,10 @@ while [ $# -gt 0 ] ; do
-- )
break
;;
+ -M | --bignum )
+ awk_opts="$awk_opts $1"
+ prepro_opts="$prepro_opts -D__bignum__=1"
+ ;;
-* )
awk_opts="$awk_opts $(shell_escape "$1")"
;;
diff --git a/testcases b/testcases
index d1a9fff..ed710e1 100644
--- a/testcases
+++ b/testcases
@@ -93,3 +93,12 @@ BEGIN {
}'
:
gawk
+--
+17:
+./cppawk -M 'BEGIN { print __bignum__ }'
+:
+1
+--
+18:
+./cppawk 'BEGIN { print __bignum__ }'
+: