callback parameter order question

gedaiu szabobogdan at yahoo.com
Sat May 11 02:52:03 PDT 2013


On Saturday, 11 May 2013 at 09:39:42 UTC, Andrej Mitrovic wrote:
> On 5/11/13, gedaiu <szabobogdan at yahoo.com> wrote:
>> alias 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;
>
> Add extern(C) to the alias:
>
> alias extern(C) int function(void **con_cls, ...) 
> MHD_AccessHandlerCallback;

if i do that, i get this error


src/import/server.d(128): Error: function 
gnu.microhttpd.MHD_start_daemon (uint flags, uint port, extern 
(C) int function(void* cls, const(sockaddr*) addr, uint addrlen) 
apc, void* apc_cls, extern (C) int function(void* cls, 
MHD_Connection* connection, const(char*) url, const(char*) 
method, const(char*) ver, const(char*) upload_data, ulong* 
upload_data_size, void** con_cls) dh, void* dh_cls, ...) is not 
callable using argument types 
(MHD_FLAG,int,typeof(null),typeof(null),int function(void* cls, 
MHD_Connection* connection, const(char*) url, const(char*) 
method, const(char*) ver, const(char*) upload_data, ulong* 
upload_data_size, void** ptr) @system,typeof(null),MHD_OPTION)
src/import/server.d(128): Error: cannot implicitly convert 
expression (ahc_echo) of type int function(void* cls, 
MHD_Connection* connection, const(char*) url, const(char*) 
method, const(char*) ver, const(char*) upload_data, ulong* 
upload_data_size, void** ptr) @system to extern (C) int 
function(void* cls, MHD_Connection* connection, const(char*) url, 
const(char*) method, const(char*) ver, const(char*) upload_data, 
ulong* upload_data_size, void** con_cls)


More information about the Digitalmars-d-learn mailing list