def check_funcs_at_once(conf, funcs, libs=None):
    if libs is None:
        libs = []

    header = []
    header = ['#ifdef __cplusplus']
    header.append('extern "C" {')
    header.append('#endif')
    for f in funcs:
        header.append("\tchar %s();" % f)
        # Handle MSVC intrinsics: force MS compiler to make a function
        # call. Useful to test for some functions when built with
        # optimization on, to avoid build error because the intrinsic
        # and our 'fake' test declaration do not match.
        header.append("#ifdef _MSC_VER")
        header.append("#pragma function(%s)" % f)
        header.append("#endif")
    header.append('#ifdef __cplusplus')
    header.append('};')
    header.append('#endif')
    header = "\n".join(header)

    tmp = []
    for f in funcs:
        tmp.append("\t%s();" % f)
    tmp = "\n".join(tmp)

    body = r"""
%(include)s
%(header)s

int main (void)
{
    %(tmp)s
        return 0;
}
""" % {"tmp": tmp, "include": "", "header": header}

    conf.start_message("Checking for functions %s" % ", ".join(funcs))
    old_lib = copy.deepcopy(conf.env["LIBS"])
    try:
        for lib in libs[::-1]:
            conf.env["LIBS"].insert(0, lib)
        ret = conf.builders["ctasks"].try_program("check_func", body, None)
        if ret:
            conf.end_message("yes")
        else:
            conf.end_message("no !")
    finally:
        conf.env["LIBS"] = old_lib

    for func in funcs:
        conf.conf_results.append({"type": "func", "value": func,
                                  "result": ret})
    return ret
dataset/ETHPy150Open cournape/Bento/bento/private/_yaku/yaku/conftests/conftests.py/check_funcs_at_once/original