Output BEGIN/END_INTERFACE for C++ base classes too.

This commit is contained in:
Alexandre Julliard 2004-08-22 22:31:52 +00:00
parent 59302aed35
commit cfb3b7e81f
2 changed files with 18 additions and 5 deletions

View File

@ -36,6 +36,8 @@ struct __attribute__((com_interface)) IUnknown
struct IUnknown
#endif
{
BEGIN_INTERFACE
virtual HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject) = 0;
@ -46,6 +48,7 @@ struct IUnknown
virtual ULONG STDMETHODCALLTYPE Release(
) = 0;
END_INTERFACE
};
#else
typedef struct IUnknownVtbl IUnknownVtbl;

View File

@ -745,7 +745,14 @@ void write_com_interface(type_t *iface)
/* C++ interface */
fprintf(header, "#if defined(__cplusplus) && !defined(CINTERFACE)\n");
if (iface->ref)
{
fprintf(header, "struct %s : public %s\n", iface->name, iface->ref->name);
fprintf(header, "{\n");
indentation++;
write_cpp_method_def(iface);
indentation--;
fprintf(header, "};\n");
}
else
{
fprintf(header, "#ifdef ICOM_USE_COM_INTERFACE_ATTRIBUTE\n");
@ -753,12 +760,15 @@ void write_com_interface(type_t *iface)
fprintf(header, "#else\n");
fprintf(header, "struct %s\n", iface->name);
fprintf(header, "#endif\n");
fprintf(header, "{\n");
fprintf(header, " BEGIN_INTERFACE\n");
fprintf(header, "\n");
indentation++;
write_cpp_method_def(iface);
indentation--;
fprintf(header, " END_INTERFACE\n");
fprintf(header, "};\n");
}
fprintf(header, "{\n");
indentation++;
write_cpp_method_def(iface);
indentation--;
fprintf(header, "};\n");
fprintf(header, "#else\n");
/* C interface */
fprintf(header, "typedef struct %sVtbl %sVtbl;\n", iface->name, iface->name);