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