def if_cond_text(conds, text):
    """Return the result of making some text conditional under #if.  The
    text ends with a newline, as does the return value if not empty."""
    if '0' in conds:
        return ''
    conds = [c for c in conds if c != '1']
    conds = sorted(set(conds))
    if not conds:
        return text
    return '#if %s\n%s#endif\n' % (' && '.join(conds), text)