Shouldn't c_long and c_ulong be library typedefs?
Andrej Mitrovic
andrej.mitrovich at gmail.com
Wed Sep 5 17:32:55 PDT 2012
On 9/6/12, bearophile <bearophileHUGS at lycos.com> wrote:
> In Phobos there is a Typedef, but it's unusable :-(
I forgot to mention, I'm using GDC which is based on 2.059 or earlier,
and which can't compile the Typedef in 2.060 Phobos due to an ICE.
On 9/6/12, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> I'd always expect them to be aliases.
> I'm fairly sure that the C
> linker is going to see any difference between int and long either if long is
> the same size as int
Sorry, I should have been more clear. :)
I'm aware of linker issues but this is handled by uniquely naming
extern(C) functions. Here's an example of how a D virtual would be
invoked:
extern(C) void test__1234_0001(void* d_object, uint* val)
{
(cast(SomeClass)d_object).test(val);
}
extern(C) void test__1234_0002(void* d_object, c_ulong* val)
{
(cast(SomeClass)d_object).test(val);
}
More information about the Digitalmars-d
mailing list