Replacing built-in complex? What's this about?

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Tue Dec 30 06:01:29 PST 2008


Walter Bright wrote:
[Re: link compatibility and library complex types]
> 
> For link compatibility, this is not the issue it seems to be because C 
> doesn't have name mangling. Parameter passing/return sequences can 
> easily be made compatible with a struct complex.

Are you sure about that? Isn't there some calling convention where 
complexes and equivalent structs are treated differently?

IIRC either the x86 C calling convention or the x86-64 one falls into 
this category for returning them from functions.
I also seem to recall passing them as parameters is different on x86-64 
when only one register is available -- passing the "native" version in 
one register and a stack slot while the struct is put entirely on the stack.
Both of these are off the top of my head though, so I might be mistaken 
since I haven't looked at the specs recently and these weren't really 
the things I paid attention to when I did.



More information about the Digitalmars-d mailing list