callback parameter order question

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat May 11 06:51:07 PDT 2013


On 5/11/13, gedaiu <szabobogdan at yahoo.com> wrote:
> i have this code, and i don't think i can add extern(C) there

That's a problem with the parser. Instead of auto use the actual function type:

alias extern(C) int function(void **con_cls,
    size_t *upload_data_size,
    const char *upload_data,
    const char *ver,
    const char *method,
    const char *url,
    MHD_Connection* connection,
    void* cls) MHD_AccessHandlerCallback;

...

MHD_AccessHandlerCallback ahc_echo = function(void* cls,
        MHD_Connection* connection,
        const char *url,
        const char *method,
        const char *ver,
        const char *upload_data,
        size_t *upload_data_size,
        void **ptr) {
                ...
};


More information about the Digitalmars-d-learn mailing list