Fix canvas.split on non-fore situation.
[screen-lua.git] / src / etc / ccdefs
blob2fc98fff1a140866e116da66e7b19414251ab960
1 #!/bin/sh
2 cd /tmp
3 umask 022
5 CC=cc
6 CPP=cpp
7 PATH="$PATH:/lib"
9 TEMP=def$$
10 trap 'rm -f ${TEMP}*; trap 0; exit' 0 1 2 3 15
12 set `type $CC`
13 q=$#
14 set x `type $CC`
15 shift $q
16 cc=$1
18 set `type $CPP`
19 q=$#
20 set x `type $CPP`
21 shift $q
22 cpp=$1
24 strings - "$cc" 2>/dev/null | tr ' ' '\012' > ${TEMP}.x
26 if test -x "$cpp"; then
27 strings - "$cpp" 2>/dev/null | tr ' ' '\012' >> ${TEMP}.x
28 else
29 echo "Warning: cpp not found."
32 sort < ${TEMP}.x | uniq | awk '
33 /^-D[A-Za-z_][A-Za-z_0-9]*$/ {
34 printf("#ifdef %s\n", substr($0,3))
35 printf("\"%s\": %s\n", substr($0,3), substr($0,3))
36 print "#endif"
38 /^[A-Za-z_][A-Za-z_0-9]*$/ {
39 printf("#ifdef %s\n", $0)
40 printf("\"%s\": %s\n", $0, $0)
41 print "#endif"
43 ' > ${TEMP}.c
45 echo "Defines in cc are:"
46 cc -E ${TEMP}.c | sed -n -e 's/"\([^:]*\)":/\1:/p' | sort | uniq