alias and extern(C)

Laeeth Isharc via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 30 13:24:57 PDT 2014


>> The code below works fine if you remove the extern(C).  But I 
>> get the error "functionpointertest.d(6): Error: basic type 
>> expected, not extern" with the code as it  is.
>>
>> How do I use alias with extern ?
> [...]
>> alias Callback= extern(C) void function(int);
>
> Compiles as is with dmd 2.066. For 2.065 and older you have to
> put extern(C) in front of "alias":
>
> extern(C) alias Callback= void function(int);

Many thanks, anon.

You are right - I was running older dmd on this machine.  It 
works fine with your modification, as you suggest.


Laeeth.


More information about the Digitalmars-d-learn mailing list