On 20 July 2017 at 15:55, Jacek Caban jacek@codeweavers.com wrote:
With that, using our headers would require modifications in compiled code compatible with MSVC, so there would be a point in having a nice to use macro that interface implementations could use to decide if they should apply needed changes.
But if you have to make (minor) modifications to implementations, is that really any better than just explicitly listing the return pointer in the implementation? (Regardless of how easy/hard/ugly such a macro would need to be.)
You can't unconditionally do that if you want to keep sources compatible with MSVC.
It's not really a property of the compiler though. An application using the Wine headers should compile correctly with MSVC as well. On the other hand, it does imply an incompatibility with the PSDK headers. Unfortunately no amount of macros we add is going to avoid that, they simply wouldn't be available when using the PSDK headers.
What I meant is that such code could use WIDL_EXPLICIT_AGGREGATED_RETURN for required #ifdefs (just like we can use it to generate declarations both with and without the workaround).
I'm fine with hiding these behind WIDL_EXPLICIT_AGGREGATED_RETURN, although I'd prefer WIDL_EXPLICIT_AGGREGATE_RETURNS. I'm less convinced about automatically enabling or disabling that based on the compiler used. I think I'd rather have the user of the header explicitly enable them, not unlike how WIDL_C_INLINE_WRAPPERS works.