widl: Guard RPC includes with #ifdef _WIN32.

This makes it easier to use header files generated by widl without
Windows headers.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Józef Kucia 2018-11-19 15:07:02 +01:00 committed by Alexandre Julliard
parent f86e796574
commit b7402ddbbe
1 changed files with 3 additions and 3 deletions

View File

@ -1784,15 +1784,15 @@ void write_header(const statement_list_t *stmts)
}
fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n\n", PACKAGE_VERSION, input_name);
fprintf(header, "#ifdef _WIN32\n");
fprintf(header, "#ifndef __REQUIRED_RPCNDR_H_VERSION__\n");
fprintf(header, "#define __REQUIRED_RPCNDR_H_VERSION__ 475\n");
fprintf(header, "#endif\n\n");
fprintf(header, "#endif\n");
fprintf(header, "#include <rpc.h>\n" );
fprintf(header, "#include <rpcndr.h>\n" );
if (!for_each_serializable(stmts, NULL, serializable_exists))
fprintf(header, "#include <midles.h>\n" );
fprintf(header, "\n" );
fprintf(header, "#endif\n\n");
fprintf(header, "#ifndef COM_NO_WINDOWS_H\n");
fprintf(header, "#include <windows.h>\n");