Extern Keyword for Function Type

Jeroen Bollen jbinero at gmail.com
Tue Apr 15 13:16:50 PDT 2014


On Tuesday, 15 April 2014 at 20:15:42 UTC, Jeroen Bollen wrote:
> exten(C) {
>     testFunction(int function(int));
> }
>
> testFunction now requires an external function as parameter. It 
> can't be called with a pointer to a D function.
>
> Logical Solution:
>
> extern(C) {
>     testFunction(extern(D) int function(int)); // DOES NOT 
> COMPILE
> }
>
> How do you fix this without moving it outside the global extern 
> block?

Whoops, assume testFunction is defined as "void testFunction(...)"


More information about the Digitalmars-d-learn mailing list