extern(C) delegate

2013-12-04 Thread Mariusz `shd` Gliwiński
I'd like to expose my D API to C code. For that, i'm going to write templates generate extern(C) definition alongside of D-one. One thing i could do, is to generate D struct that mimics delegate with appropriate arguments. However, i'm curious of another possibility: How do i call extern(C) v

Re: extern(C) delegate

2013-12-04 Thread Rémy Mouëza
I had played with that idea and searched the forums once. I came up with the following proof-of-concept code. in C (c_dg.c) { #include /// This is how a delegate is implemented (currently). typedef struct Dg { /// The context (class instance or frame or null). void