August 15, 2012
On Wednesday, 15 August 2012 at 11:15:35 UTC, Paulo Pinto wrote:
> Does this not required that the D and C compiler are in sync about data layout?
>
> Small sizes structs are often kept in registers.

Yes, extern(C) is intended to be fully ABI-compatible with the respective C ABI on the host system. On *nix systems, this means that the System V AMD64 ABI is followed for parameter passing. The DMD implementation of it, however, still has bugs in the cases mentioned above, as the register assignment scheme is difficult to implement in Walter's backend. The current state _is_ self-consistent, though, so the problems only surface when interfacing with C code.

David
August 15, 2012
On 8/15/2012 3:28 AM, Jacob Carlborg wrote:
> On 2012-08-14 23:05, Walter Bright wrote:
>
>> It does pass them correctly to D functions, just not to C ones if the
>> struct contains a mix of floating and integer types.
>
> Ok, so if my structs don't contain any floating point types I will be fine?

Yes.

> All other types are ok?

Yes.

> Is this in the 2.060 release

Yes.

> or do I have get the latest sources from github?

No.


August 15, 2012
On 2012-08-15 21:48, Walter Bright wrote:

>> Ok, so if my structs don't contain any floating point types I will be
>> fine?
>
> Yes.
>
>> All other types are ok?
>
> Yes.
>
>> Is this in the 2.060 release
>
> Yes.
>
>> or do I have get the latest sources from github?
>
> No.
>
>

Thank you.

-- 
/Jacob Carlborg
August 15, 2012
On 8/14/2012 2:44 AM, Bernard Helyer wrote:
> Clearly the solution is to look into cloning technologies.

There can be only one.

August 20, 2012
On Saturday, 11 August 2012 at 08:17:13 UTC, Walter Bright wrote:
> No, it ain't much, some of it is jury rigged, and there's a heluva lot more work to do. But we've got liftoff!
>
> -------------------------------------
> import core.stdc.stdio;
>
> extern (C) int main()
> {
>     puts("hello world\n");
>     return 0;
> }
> -------------------------------------
>
>   dmd -c -m64 hello.d
>   cl hello.obj
>   hello
>
> hello world!

Great News! Congratulations!
August 21, 2012
yeha :-) +1
Next ›   Last »
1 2 3 4 5 6 7 8
Top | Discussion index | About this forum | D home