]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/xen/cppx
bcm: flush out early boot messages on uart and screen initialization
[plan9front.git] / sys / src / 9 / xen / cppx
1 #!/bin/rc
2 awk '
3 function qq(s) {
4         gsub("\"", "£", s)
5         return "\"@" s "\""
6 }
7
8 /^#include/     { next
9 }
10 /^#define.*\\$/ {
11         save[n++] = $0
12         print qq($0 "\\")
13         next
14 }
15 (n > 0) && /\\$/ {
16         save[n++] = $0
17         print qq($0 "\\")
18         next
19 }
20 (n > 0)  {
21         save[n++] = $0
22         print qq($0)
23         for (i = 0; i < n; i++) print save[i]
24         n = 0
25         next
26 }
27 /^# *((define)|(error)).*[^\\]*$/ {
28         print qq($0)
29         print
30         next
31 }
32 /^# *undef.*[^\\]*$/ {
33         print
34         print qq($0)
35         next
36 }
37         { print
38 }
39 ' $* |
40 cpp -P |
41 sed -e 's/£/"/g' -e 's/^"@(.*\\)\\"$/\1/' -e 's/^"@(.*)"$/\1/'