diff options
author | Emmanuel Ackaouy <ack@xensource.com> | 2007-01-10 17:56:54 +0000 |
---|---|---|
committer | Emmanuel Ackaouy <ack@xensource.com> | 2007-01-10 17:56:54 +0000 |
commit | 2736a406e4eac36a6de7a3b5e08b7f30da038f35 (patch) | |
tree | d469b1f23a86bb92ea03ac598d6b7c1e3278875b /xen/tools/compat-build-header.py | |
parent | 7220350010061dfd1c354397d7a25ec6829ae88a (diff) | |
download | xen-2736a406e4eac36a6de7a3b5e08b7f30da038f35.tar.gz xen-2736a406e4eac36a6de7a3b5e08b7f30da038f35.tar.bz2 xen-2736a406e4eac36a6de7a3b5e08b7f30da038f35.zip |
[XEN] Partial fix for compat build non-portability.
Signed-off-by: John Levon <john.levon@sun.com>
Diffstat (limited to 'xen/tools/compat-build-header.py')
-rwxr-xr-x | xen/tools/compat-build-header.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/xen/tools/compat-build-header.py b/xen/tools/compat-build-header.py new file mode 100755 index 0000000000..6fb795eaaa --- /dev/null +++ b/xen/tools/compat-build-header.py @@ -0,0 +1,21 @@ +#!/usr/bin/python + +import re,sys + +pats = [ + [ r"__InClUdE__", r"#include" ], + [ r"\"xen-compat.h\"", r"<public/xen-compat.h>" ], + [ r"(struct|union|enum)\s+(xen_?)?(\w)", r"\1 compat_\3" ], + [ r"@KeeP@", r"" ], + [ r"_t([^\w]|$)", r"_compat_t\1" ], + [ r"(8|16|32|64)_compat_t([^\w]|$)", r"\1_t\2" ], + [ r"(^|[^\w])xen_?(\w*)_compat_t([^\w]|$$)", r"\1compat_\2_t\3" ], + [ r"(^|[^\w])XEN_?", r"\1COMPAT_" ], + [ r"(^|[^\w])Xen_?", r"\1Compat_" ], + [ r"(^|[^\w])long([^\w]|$$)", r"\1int\2" ] +]; + +for line in sys.stdin.readlines(): + for pat in pats: + line = re.subn(pat[0], pat[1], line)[0] + print line.rstrip() |