Hi Takashi,
On Thursday 13 of November 2008, Takashi Ono wrote:
> I have copied most part of the current mingw c++ uno bridge code from linux
> implementation and it works if -fpcc-struct-return is specified in
> solenv/inc/wntgcci6.mk
>
> However, the default is -freg-struct-return on mingw.
Generally it should not be that hard to extend it so that we can
handle -freg-struct-return ;-) According to what I've read in the gcc man
page, the only difference is that small structs are returned in registers.
To extend the code, you should find an ABI description of exactly what
structures (how big) are involved, and either create a new
privateSnippetExecutorSmallClass [see below] + change cpp2uno.cxx so that
that one is called for the small classes, or modify
updateprivateSnippetExecutorClass accordingly [so that it decides the actual
size of the class, and acts as needed].
To me, the easiest way to do something like this was to create a small example
function that returns what you need [in this case a small structure - the ABI
description should be more verbose on what it actually is ;-)], and run:
gcc -S -freg-struct-return your_example.c -o your_example_reg_return.s
gcc -S -fpcc-struct-return your_example.c -o your_example_pcc_return.s
your_example_*.s then contains the actual assembler that you can use in
call.s; you can compare both to see what is the actual difference.
Unfortunately, I don't have time now to help with this :-( - though I'd be
very interested...
[Generally, your_example.c would look something like:
struct my_struct {
int a;
};
struct my_struct function( int b )
{
struct my_struct s;
s.a = b;
return s;
}
]
HTH,
Kendy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]