delegates with C linkage

Simen kjaeraas simen.kjaras at gmail.com
Sat Jun 5 01:34:41 PDT 2010


Mike Parker <aldacron at gmail.com> wrote:

> For starters, your first delegate is declared in an extern(C) block,  
> meaning it has C linkage. The second is declared outside of the block,  
> meaning it has D linkage. So they are two different types of delegates.

If this is correct, the problem should be fixable by writing

extern(C) void d_foo_add_event_handler(Foo, void delegate());

or (not entirely sure about this one)

alias void delegate() voidDelegate;
extern(C) {
     void d_foo_add_event_handler(Foo, voidDelegate);
}

-- 
Simen


More information about the Digitalmars-d-learn mailing list