direct-io.hg

annotate xen/tools/compat-build-header.py @ 13656:78b7ec4e7b86

Fix compat build for weird solaris gcc target.
Signed-off-by: John Levon <john.levon@sun.com>
author kaf24@localhost.localdomain
date Sun Jan 28 16:05:07 2007 +0000 (2007-01-28)
parents b61be7771104
children
rev   line source
ack@13324 1 #!/usr/bin/python
ack@13324 2
ack@13324 3 import re,sys
ack@13324 4
ack@13324 5 pats = [
kaf24@13656 6 [ r"__InClUdE__(.*)", r"#include\1\n#pragma pack(4)" ],
ack@13324 7 [ r"\"xen-compat.h\"", r"<public/xen-compat.h>" ],
ack@13324 8 [ r"(struct|union|enum)\s+(xen_?)?(\w)", r"\1 compat_\3" ],
ack@13324 9 [ r"@KeeP@", r"" ],
ack@13324 10 [ r"_t([^\w]|$)", r"_compat_t\1" ],
ack@13324 11 [ r"(8|16|32|64)_compat_t([^\w]|$)", r"\1_t\2" ],
ack@13324 12 [ r"(^|[^\w])xen_?(\w*)_compat_t([^\w]|$$)", r"\1compat_\2_t\3" ],
ack@13324 13 [ r"(^|[^\w])XEN_?", r"\1COMPAT_" ],
ack@13324 14 [ r"(^|[^\w])Xen_?", r"\1Compat_" ],
ack@13324 15 [ r"(^|[^\w])long([^\w]|$$)", r"\1int\2" ]
ack@13324 16 ];
ack@13324 17
ack@13324 18 for line in sys.stdin.readlines():
ack@13324 19 for pat in pats:
ack@13324 20 line = re.subn(pat[0], pat[1], line)[0]
ack@13324 21 print line.rstrip()