Commit cfb3b7e8 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 59302aed
...@@ -36,6 +36,8 @@ struct __attribute__((com_interface)) IUnknown ...@@ -36,6 +36,8 @@ struct __attribute__((com_interface)) IUnknown
struct IUnknown struct IUnknown
#endif #endif
{ {
BEGIN_INTERFACE
virtual HRESULT STDMETHODCALLTYPE QueryInterface( virtual HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid, REFIID riid,
void** ppvObject) = 0; void** ppvObject) = 0;
...@@ -46,6 +48,7 @@ struct IUnknown ...@@ -46,6 +48,7 @@ struct IUnknown
virtual ULONG STDMETHODCALLTYPE Release( virtual ULONG STDMETHODCALLTYPE Release(
) = 0; ) = 0;
END_INTERFACE
}; };
#else #else
typedef struct IUnknownVtbl IUnknownVtbl; typedef struct IUnknownVtbl IUnknownVtbl;
......
...@@ -745,7 +745,14 @@ void write_com_interface(type_t *iface) ...@@ -745,7 +745,14 @@ void write_com_interface(type_t *iface)
/* C++ interface */ /* C++ interface */
fprintf(header, "#if defined(__cplusplus) && !defined(CINTERFACE)\n"); fprintf(header, "#if defined(__cplusplus) && !defined(CINTERFACE)\n");
if (iface->ref) if (iface->ref)
{
fprintf(header, "struct %s : public %s\n", iface->name, iface->ref->name); 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 else
{ {
fprintf(header, "#ifdef ICOM_USE_COM_INTERFACE_ATTRIBUTE\n"); fprintf(header, "#ifdef ICOM_USE_COM_INTERFACE_ATTRIBUTE\n");
...@@ -753,12 +760,15 @@ void write_com_interface(type_t *iface) ...@@ -753,12 +760,15 @@ void write_com_interface(type_t *iface)
fprintf(header, "#else\n"); fprintf(header, "#else\n");
fprintf(header, "struct %s\n", iface->name); fprintf(header, "struct %s\n", iface->name);
fprintf(header, "#endif\n"); 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"); fprintf(header, "#else\n");
/* C interface */ /* C interface */
fprintf(header, "typedef struct %sVtbl %sVtbl;\n", iface->name, iface->name); fprintf(header, "typedef struct %sVtbl %sVtbl;\n", iface->name, iface->name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment