Message ID | 20180212072207.9367-12-armbru@redhat.com |
---|---|
State | New |
Headers | show |
Series | None | expand |
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 1b254d5b32..1a78dfaf3f 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -1973,6 +1973,24 @@ def guardend(name): name=guardname(name)) +def gen_if(ifcond): + ret = '' + for ifc in ifcond: + ret += mcgen(''' +#if %(cond)s +''', cond=ifc) + return ret + + +def gen_endif(ifcond): + ret = '' + for ifc in reversed(ifcond): + ret += mcgen(''' +#endif /* %(cond)s */ +''', cond=ifc) + return ret + + def gen_enum_lookup(name, values, prefix=None): ret = mcgen('''