"Francois Gouget" fgouget@free.fr wrote:
COBJMACROS is very C unfriendly as it requires the caller to define it if it wants to use COM objects. The following check is much better as it does the right thing automagically:
#if !defined (__cplusplus) || defined(CINTERFACE)
So for internal interface, let's use the C friendly check instead of COBJMACROS. This way we'll have fewer '#define COBJMACROS' to sprinkle through the code.
But that change makes Wine code not compilable with SDK and Mingw headers, I don't think it's an acceptable change.
On Fri, 1 Oct 2004, Dmitry Timoshkov wrote:
"Francois Gouget" fgouget@free.fr wrote:
COBJMACROS is very C unfriendly as it requires the caller to define it if it wants to use COM objects. The following check is much better as it does the right thing automagically:
#if !defined (__cplusplus) || defined(CINTERFACE)
So for internal interface, let's use the C friendly check instead of COBJMACROS. This way we'll have fewer '#define COBJMACROS' to sprinkle through the code.
But that change makes Wine code not compilable with SDK and Mingw headers, I don't think it's an acceptable change.
Do you mean this change in particular (i.e. not using COBJMACROS for protecting internal Wine structures) or the COBJMACROS change in general?
Why would it break compilation with the SDK and Mingw headers?
"Francois Gouget" fgouget@free.fr wrote:
But that change makes Wine code not compilable with SDK and Mingw headers, I don't think it's an acceptable change.
Do you mean this change in particular (i.e. not using COBJMACROS for protecting internal Wine structures) or the COBJMACROS change in general?
I mean using COBJMACROS for protecting internal Wine structures.
Why would it break compilation with the SDK and Mingw headers?
I wrongly formulated the problem: it will Wine internal COM interfaces not follow the standard practice, be contradict and confuse the Wine code.
On Fri, 1 Oct 2004, Dmitry Timoshkov wrote: [...]
Why would it break compilation with the SDK and Mingw headers?
I wrongly formulated the problem: it will Wine internal COM interfaces not follow the standard practice, be contradict and confuse the Wine code.
That's the thing, the standard seems to be that: * headers generated from idl files use COBJMACROS * manually written files tend to use !__cplusplus || CINTERFACE * but there are also some manually written headers that use COBJMACROS though there's only one such file in Wine currently control.h, a DirectX header. (mediaobj.h is another but only because we are missing the corresponding idl file)
Since the headers defining our internal interfaces are written by hand it would be more consistent (if anything) if they did not use COBJMACROS.