Callbacks and interfacing with C

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Tue Oct 30 03:13:36 PDT 2012


Ok, a C function pointer like this:

    struct MyStruct{
        int (*foo)(int);
    };

Translates to D as this:

    struct MyStruct{
        int function(int) foo;
    }

But what about calling conventions? There isn't any "int extern(C)
function(int)" is there? Not sure if that would even make sense.

So do you just make sure that whatever func you assign to it is an
extern(C)? Or something else?



More information about the Digitalmars-d-learn mailing list