Declaring a D pointer to a C function

Trass3r un at known.com
Tue Jul 12 04:15:38 PDT 2011


> You should declare the function pointer without the "extern(C)".
>
> Example:
> alias int function(void* test) FTInitFunc;
>
> extern(C) int foo(void* test){ .... }
>
> FTInitFunc foo_ptr = &foo;
>
> This worked for me.

That's a bug.


More information about the Digitalmars-d-learn mailing list