Use the same include guard in WIDL generated files and MIDL generated files

svn path=/trunk/; revision=32274
This commit is contained in:
Hervé Poussineau 2008-02-10 19:47:42 +00:00
parent b84c9620fb
commit 00d89c1d5d
2 changed files with 36 additions and 4 deletions

View file

@ -174,7 +174,7 @@ static char *make_token(const char *name)
token = xstrdup(name);
for (i=0; token[i]; i++) {
if (!isalnum(token[i])) token[i] = '_';
else token[i] = toupper(token[i]);
else token[i] = tolower(token[i]);
}
return token;
}
@ -561,8 +561,8 @@ int main(int argc,char *argv[])
fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION, input_name);
fprintf(header, "#include <rpc.h>\n" );
fprintf(header, "#include <rpcndr.h>\n\n" );
fprintf(header, "#ifndef __WIDL_%s\n", header_token);
fprintf(header, "#define __WIDL_%s\n", header_token);
fprintf(header, "#ifndef __%s__\n", header_token);
fprintf(header, "#define __%s__\n", header_token);
start_cplusplus_guard(header);
}
@ -606,7 +606,7 @@ int main(int argc,char *argv[])
fprintf(header, "/* End additional prototypes */\n");
fprintf(header, "\n");
end_cplusplus_guard(header);
fprintf(header, "#endif /* __WIDL_%s */\n", header_token);
fprintf(header, "#endif /* __%s__ */\n", header_token);
fclose(header);
}

View file

@ -60,6 +60,38 @@ Index: typelib.c
#include "widl.h"
#include "utils.h"
Index: widl.c
===================================================================
--- widl.c (revision 32187)
+++ widl.c (working copy)
@@ -174,7 +174,7 @@
token = xstrdup(name);
for (i=0; token[i]; i++) {
if (!isalnum(token[i])) token[i] = '_';
- else token[i] = toupper(token[i]);
+ else token[i] = tolower(token[i]);
}
return token;
}
@@ -561,8 +561,8 @@
fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION, input_name);
fprintf(header, "#include <rpc.h>\n" );
fprintf(header, "#include <rpcndr.h>\n\n" );
- fprintf(header, "#ifndef __WIDL_%s\n", header_token);
- fprintf(header, "#define __WIDL_%s\n", header_token);
+ fprintf(header, "#ifndef __%s__\n", header_token);
+ fprintf(header, "#define __%s__\n", header_token);
start_cplusplus_guard(header);
}
@@ -606,7 +606,7 @@
fprintf(header, "/* End additional prototypes */\n");
fprintf(header, "\n");
end_cplusplus_guard(header);
- fprintf(header, "#endif /* __WIDL_%s */\n", header_token);
+ fprintf(header, "#endif /* __%s__ */\n", header_token);
fclose(header);
}
Index: widltypes.h
===================================================================
--- widltypes.h (revision 32187)