Why is the ABI for structs different between Linux and Windows?

Walter Bright newshound1 at digitalmars.com
Sat May 17 14:20:16 PDT 2008


Robert Fraser wrote:
> Walter Bright wrote:
>> Robert Fraser wrote:
>>> Walter Bright wrote:
>>>> The struct ABI is designed to be compatible with the C struct 
>>>> behavior for the local C compiler.
>>>
>>> Is it possible to just use this behavior for extern(C) structs while 
>>> structs with D linkage use the Windows behavior on Linux, too?
>>
>> Why do that? You can control the layout with the align attribute, if 
>> need be.
> 
> How would that allow an 8-byte struct to be passed in registers on Linux?

You can do that now if you use the D function calling convention. Using 
extern(C) gives you the C calling convention.



More information about the Digitalmars-d mailing list