Re: [PATCH 1/5] widl: Introduce an "aggregate_return" function attribute.
Henri Verbeet <hverbeet(a)codeweavers.com> writes:
For MSVC style handling of aggregate return values. This probably doesn't make anyone particularly happy; I'm open to suggestions. It may be possible to do this without an attribute, based on the function declaration, but then we'd have to figure out how MSVC decides when to use registers and when to use the stack for the return value.
The attribute is certainly ugly. Also it seems to me you are doing this the wrong way around; you don't want to add a return parameter, you want to avoid one. Check how div() is handled. -- Alexandre Julliard julliard(a)winehq.org
On 4 September 2014 15:27, Alexandre Julliard <julliard(a)winehq.org> wrote:
The attribute is certainly ugly. Well, no argument there. Do we have any alternatives? We could of course also just change the function prototype, but then that would break source compatibility.
Also it seems to me you are doing this the wrong way around; you don't want to add a return parameter, you want to avoid one. Check how div() is handled.
No, the issue is that gcc returns the result in eax:edx, but native expects a return parameter, so the reverse of MSVCRT_div(). It's most obvious when running d2d1 tests (not submitted yet) compiled with mingw against Windows.
Henri Verbeet <hverbeet(a)gmail.com> writes:
No, the issue is that gcc returns the result in eax:edx, but native expects a return parameter, so the reverse of MSVCRT_div(). It's most obvious when running d2d1 tests (not submitted yet) compiled with mingw against Windows.
Mingw implements the Windows convention, so it's different from plain gcc. I'm not sure your test means what you think it means. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Henri Verbeet