summaryrefslogtreecommitdiff
path: root/qnx/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qnx/cpp')
-rwxr-xr-xqnx/cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/qnx/cpp b/qnx/cpp
index e69de29bb2..6459af249f 100755
--- a/qnx/cpp
+++ b/qnx/cpp
@@ -0,0 +1,24 @@
+#! /bin/sh
+#__USAGE
+#%C [-P] [-C] other options
+# cpp is a wrapper for wcc to make it work like other cpp's
+# -P omit #line directives from the output
+# -C pass comments through to the output
+#
+#Submitted by Norton T. Allen (allen@huarp.harvard.edu)
+
+typeset lines=l comments="" redir=""
+while :; do
+ case $1 in
+ -P) lines=""; shift; continue;;
+ -C) comments=c; shift; continue;;
+ esac
+ break
+done
+if [ ! -t 0 ]; then
+ cat >.$$.c
+ redir=.$$.c
+fi
+cc -c -Wc,-p$lines$comments -Wc,-pw=0 $* $redir |
+ awk 'NR>1||NF>0 {sub("^ ","");print}'
+[ -n "$redir" ] && rm -f $redir