[REPATCH] Re: [PATCH] Re: socketpair blip on unicos/mk, too
[p5sagit/p5-mst-13.2.git] / qnx / cpp
CommitLineData
ff68c719 1#! /bin/sh
2#__USAGE
3#%C [-P] [-C] other options
4# cpp is a wrapper for wcc to make it work like other cpp's
5# -P omit #line directives from the output
6# -C pass comments through to the output
7#
8#Submitted by Norton T. Allen (allen@huarp.harvard.edu)
9
10typeset lines=l comments="" redir=""
11while :; do
12 case $1 in
13 -P) lines=""; shift; continue;;
14 -C) comments=c; shift; continue;;
15 esac
16 break
17done
18if [ ! -t 0 ]; then
19 cat >.$$.c
20 redir=.$$.c
21fi
22cc -c -Wc,-p$lines$comments -Wc,-pw=0 $* $redir |
23 awk 'NR>1||NF>0 {sub("^ ","");print}'
24[ -n "$redir" ] && rm -f $redir