Commit 09242a8e authored by Alexandre Julliard's avatar Alexandre Julliard

Add #ifdefs around forwards and interfaces like MIDL does.

parent 675b7559
......@@ -15,12 +15,19 @@ extern "C" {
# define ICOM_MSVTABLE_COMPAT_FIELDS
# define ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
#endif
#ifndef __IUnknown_FWD_DEFINED__
#define __IUnknown_FWD_DEFINED__
typedef struct IUnknown IUnknown;
#endif
typedef IUnknown *LPUNKNOWN;
/*****************************************************************************
* IUnknown interface
*/
#ifndef __IUnknown_INTERFACE_DEFINED__
#define __IUnknown_INTERFACE_DEFINED__
DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46);
#if defined(__cplusplus) && !defined(CINTERFACE)
#ifdef ICOM_USE_COM_INTERFACE_ATTRIBUTE
......@@ -100,12 +107,21 @@ void __RPC_STUB IUnknown_Release_Stub(
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
#endif /* __IUnknown_INTERFACE_DEFINED__ */
#ifndef __IClassFactory_FWD_DEFINED__
#define __IClassFactory_FWD_DEFINED__
typedef struct IClassFactory IClassFactory;
#endif
typedef IClassFactory *LPCLASSFACTORY;
/*****************************************************************************
* IClassFactory interface
*/
#ifndef __IClassFactory_INTERFACE_DEFINED__
#define __IClassFactory_INTERFACE_DEFINED__
DEFINE_GUID(IID_IClassFactory, 0x00000001, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46);
#if defined(__cplusplus) && !defined(CINTERFACE)
struct IClassFactory : public IUnknown
......@@ -205,6 +221,8 @@ HRESULT __RPC_STUB IClassFactory_LockServer_Stub(
IClassFactory* This,
BOOL fLock);
#endif /* __IClassFactory_INTERFACE_DEFINED__ */
#ifdef __cplusplus
}
#endif
......
......@@ -660,7 +660,10 @@ void write_forward(type_t *iface)
* (i.e. this is an IDL forward), then we also assume that it is an object
* interface, since non-object interfaces shouldn't need forwards */
if ((!iface->defined || is_object(iface->attrs)) && !iface->written) {
fprintf(header,"#ifndef __%s_FWD_DEFINED__\n", iface->name);
fprintf(header,"#define __%s_FWD_DEFINED__\n", iface->name);
fprintf(header, "typedef struct %s %s;\n", iface->name, iface->name);
fprintf(header, "#endif\n\n" );
iface->written = TRUE;
}
}
......@@ -684,6 +687,8 @@ void write_com_interface(type_t *iface)
fprintf(header, "/*****************************************************************************\n");
fprintf(header, " * %s interface\n", iface->name);
fprintf(header, " */\n");
fprintf(header,"#ifndef __%s_INTERFACE_DEFINED__\n", iface->name);
fprintf(header,"#define __%s_INTERFACE_DEFINED__\n\n", iface->name);
write_guid(iface);
write_forward(iface);
/* C++ interface */
......@@ -732,6 +737,7 @@ void write_com_interface(type_t *iface)
if (!is_local(iface->attrs))
write_proxy(iface);
fprintf(header,"#endif /* __%s_INTERFACE_DEFINED__ */\n\n", iface->name);
}
void write_rpc_interface(type_t *iface)
......
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