Hi Tom,

On 2/27/18 6:04 AM, Tom Ritter wrote:
This patch adds wrapper functions around methods that are affected by
the stdcall function returning an aggregate is incompatible with MS
ABI gcc bug

Background
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64384
https://sourceforge.net/p/mingw-w64/mailman/mingw-w64-public/?style=threaded&viewmonth=201412&viewday=23

https://source.winehq.org/git/wine.git/commitdiff/b42a15513eaa973b40ab967014b311af64acbb98
https://www.winehq.org/pipermail/wine-devel/2017-July/118470.html

https://bugzilla.mozilla.org/show_bug.cgi?id=1411401

Thanks for working on this and I think we definitely want that in mingw-w64. However, my concerns from mentioned wine-devel thread also apply here. Especially given that as far as I know clang doesn't need this workaround.

widl already generates such workarounds for affected code. sadly d2d1.h isn't generated from IDL (it is in Wine, which decreases compatibility with PSDK). I'd say we should use the same #ifdefs as widl uses. For example, widl-generated GetSize would look like this (I quote it for #ifdefs, not the style):

#ifdef WIDL_EXPLICIT_AGGREGATE_RETURNS
    virtual D2D1_SIZE_F* STDMETHODCALLTYPE GetSize(
        D2D1_SIZE_F *__ret) = 0;
    D2D1_SIZE_F STDMETHODCALLTYPE GetSize(
        )
    {
        D2D1_SIZE_F __ret;
        return *GetSize(&__ret);
    }
#else
    virtual D2D1_SIZE_F STDMETHODCALLTYPE GetSize(
        ) = 0;
#endif


We should probably also think about having WIDL_EXPLICIT_AGGREGATE_RETURNS defined by default if we detect an affected compiler (meaning GCC in this case), probably somewhere in _mingw_mac.h.

Thanks,
Jacek

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to