ChangeSet ID: 15042 CVSROOT: /opt/cvs-commit Module name: wine Changes by: julliard@wine.codeweavers.com 2004/12/27 11:13:25 Modified files: tools/widl : widl.c Log message: Vincent Béron Generate only wanted files. Patch: http://cvs.winehq.org/patch.py?id=15042 Old revision New revision Changes Path 1.18 1.19 +27 -24 wine/tools/widl/widl.c Index: wine/tools/widl/widl.c diff -u -p wine/tools/widl/widl.c:1.18 wine/tools/widl/widl.c:1.19 --- wine/tools/widl/widl.c:1.18 Sun May 19 11:00:08 2013 +++ wine/tools/widl/widl.c Sun May 19 11:00:08 2013 @@ -130,7 +130,7 @@ int main(int argc,char *argv[]) extern char* optarg; extern int optind; int optc; - int ret; + int ret = 0; signal(SIGSEGV, segvhandler); @@ -201,17 +201,17 @@ int main(int argc,char *argv[]) (debuglevel & DEBUGLEVEL_PPTRACE) != 0, (debuglevel & DEBUGLEVEL_PPMSG) != 0 ); - if (!header_name) { + if (!header_name && (do_everything || header_only)) { header_name = dup_basename(input_name, ".idl"); strcat(header_name, ".h"); } - if (!typelib_name) { + if (!typelib_name && (do_everything || typelib_only)) { typelib_name = dup_basename(input_name, ".idl"); strcat(typelib_name, ".tlb"); } - if (!proxy_name) { + if (!proxy_name && do_everything) { proxy_name = dup_basename(input_name, ".idl"); proxy_token = xstrdup(proxy_name); strcat(proxy_name, "_p.c"); @@ -247,28 +247,31 @@ int main(int argc,char *argv[]) } } - header_token = make_token(header_name); + if(do_everything || header_only) { + header_token = make_token(header_name); - if(!(header = fopen(header_name, "w"))) { - fprintf(stderr, "Could not open %s for output\n", header_name); - return 1; + if(!(header = fopen(header_name, "w"))) { + fprintf(stderr, "Could not open %s for output\n", header_name); + return 1; + } + fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", WIDL_FULLVERSION, input_name); + fprintf(header, "#include \n" ); + fprintf(header, "#include \n\n" ); + fprintf(header, "#ifndef __WIDL_%s\n", header_token); + fprintf(header, "#define __WIDL_%s\n", header_token); + fprintf(header, "#ifdef __cplusplus\n"); + fprintf(header, "extern \"C\" {\n"); + fprintf(header, "#endif\n"); + + ret = yyparse(); + + fprintf(header, "#ifdef __cplusplus\n"); + fprintf(header, "}\n"); + fprintf(header, "#endif\n"); + fprintf(header, "#endif /* __WIDL_%s */\n", header_token); + fclose(header); } - fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", WIDL_FULLVERSION, input_name); - fprintf(header, "#include \n" ); - fprintf(header, "#include \n\n" ); - fprintf(header, "#ifndef __WIDL_%s\n", header_token); - fprintf(header, "#define __WIDL_%s\n", header_token); - fprintf(header, "#ifdef __cplusplus\n"); - fprintf(header, "extern \"C\" {\n"); - fprintf(header, "#endif\n"); - - ret = yyparse(); - - fprintf(header, "#ifdef __cplusplus\n"); - fprintf(header, "}\n"); - fprintf(header, "#endif\n"); - fprintf(header, "#endif /* __WIDL_%s */\n", header_token); - fclose(header); + fclose(yyin); if(ret) {