[WIDL]
authorThomas Faber <thomas.faber@reactos.org>
Tue, 16 Oct 2012 06:43:32 +0000 (06:43 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Tue, 16 Oct 2012 06:43:32 +0000 (06:43 +0000)
- Forward-declare coclasses as 'class' in C++ to fix MSVC warnings. Already applied upstream.
CORE-6587 #resolve

svn path=/trunk/; revision=57566

reactos/tools/widl/header.c

index 309eaf8..98301d2 100644 (file)
@@ -1300,7 +1300,11 @@ static void write_coclass_forward(FILE *header, type_t *cocl)
 {
   fprintf(header, "#ifndef __%s_FWD_DEFINED__\n", cocl->name);
   fprintf(header, "#define __%s_FWD_DEFINED__\n", cocl->name);
+  fprintf(header, "#ifdef __cplusplus\n");
+  fprintf(header, "typedef class %s %s;\n", cocl->name, cocl->name);
+  fprintf(header, "#else\n");
   fprintf(header, "typedef struct %s %s;\n", cocl->name, cocl->name);
+  fprintf(header, "#endif /* defined __cplusplus */\n");
   fprintf(header, "#endif /* defined __%s_FWD_DEFINED__ */\n\n", cocl->name );
 }