On Friday, 7 March 2014 at 14:04:53 UTC, Dicebot wrote:
We don't need C ABI compatibility for stuff that is not extern(C), do we?

That's a good point, though personally I'd still like some way to magic it up, even in extern(C).

Consider the example of library typedef. If C did:

typedef void* HANDLE;

and D did

struct HANDLE { void* foo; alias foo this; }

it is almost the same, but then when you declare

HANDLE OpenFile(...);

it won't work since the compiler will pass a hidden struct pointer (which is exactly what C woudl expect if it was a typedef struct { void* } on its side too) instead of expecting the value in the accumulator as it would with the void*.

Reply via email to