Module: wine Branch: master Commit: a6ab03dcd58a5ea954072aff36d310fb578f8031 URL: https://gitlab.winehq.org/wine/wine/-/commit/a6ab03dcd58a5ea954072aff36d310f...
Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Jan 24 22:19:45 2023 +0100
widl: Handle preprocess-only case separately.
---
tools/widl/widl.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-)
diff --git a/tools/widl/widl.c b/tools/widl/widl.c index f259f0abe20..7ed3bfd1f8c 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -836,29 +836,20 @@ int main(int argc,char *argv[])
atexit(rm_tempfile); input = input_name; + if (preprocess_only) exit( wpp_parse( input_name, stdout ) ); + if (!no_preprocess) { - chat("Starting preprocess\n"); - - if (!preprocess_only) - { - FILE *output; - char *name = make_temp_file( header_name, NULL ); - - if (!(output = fopen(name, "wt"))) - error("Could not open fd %s for writing\n", name); + FILE *output; + char *name;
- ret = wpp_parse( input_name, output ); - fclose( output ); - input = name; - } - else - { - ret = wpp_parse( input_name, stdout ); - } + name = make_temp_file( header_name, NULL ); + if (!(output = fopen( name, "wt" ))) error( "Could not open fd %s for writing\n", name ); + ret = wpp_parse( input_name, output ); + fclose( output ); + input = name;
- if(ret) exit(1); - if(preprocess_only) exit(0); + if (ret) exit( 1 ); }
if(!(parser_in = fopen(input, "r"))) {