[m-dev.] Re: fastcall for the x86
Fergus Henderson
fjh at cs.mu.OZ.AU
Sat Nov 25 12:05:29 AEDT 2000
On 24-Nov-2000, Peter Ross <peter.ross at miscrit.be> wrote:
> The first problem with this diff is that the MR_CALL macro is in the
> wrong spot for MSVC, it needs to come after the return type :(. eg.
>
> void MR_CALL function(int arg);
GNU C supports that syntax too.
For GNU C, you can put the attribute in any of three different places:
MR_CALL void function(int arg); // (1)
void MR_CALL function(int arg); // (2)
void function(int arg) MR_CALL; // (3)
Originally GNU used only the last one (3); the others were added
mainly for compatibility with MSVC, I thought. I didn't realize
that MSVC didn't support (1).
> I guess the easiest (only?) solution would be to change MR_CALL to be a
> macro which takes one argument, the return type.
>
> MR_CALL(void) function(int arg);
I suggest you just swap the order, i.e. use (2), since that will work
with both gcc and MSVC.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list