libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] Help with a change in the code with version 0.9.71


From: Evgeny Grin
Subject: Re: [libmicrohttpd] Help with a change in the code with version 0.9.71
Date: Mon, 09 Nov 2020 14:50:13 +0300

Hello Chris,
 
MHD changed return type for many functions from "int" to "enum MHD_Result". While it's binary compatible with previous version, you need to update your code to eliminate compiler warnings.
Please check this maillist archive, it was already discussed.
 
-- 
Best Wishes,
Evgeny Grin
 
 
 
07.11.2020, 00:24, "Chris" <chris@lewis.ca>:

Hello,

I build my own Windows DLL with Libmicrohttpd. This week I downloaded
Version 0.9.71 and now I have a warning that I can't seem to fix.

I appologize ahead of time if this has been discussed on the list, I
have been busy with other things and have not subscribed for a little while.

I would appreciate some guidance. It would seem that the prototype for
some of the callback functions have changed.

Here are my warnings...

httpd.c(485) : warning C4133: 'function' : incompatible types - from
'int (__cdecl *)(void *,const sockaddr *,socklen_t)' to
'MHD_AcceptPolicyCallback'
httpd.c(487) : warning C4133: 'function' : incompatible types - from
'int (__cdecl *)(void *,MHD_Connection *,const char *,const char *,const
char *,const char *,size_t *,void **)' to 'MHD_AccessHandlerCallback'
httpd.c(689) : warning C4133: 'function' : incompatible types - from
'int (__cdecl *)(void *,MHD_ValueKind,const char *,const char *,const
char *,const char *,const char *,uint64_t,size_t)' to 'MHD_PostDataIterator'
httpd.c(732) : warning C4133: 'function' : incompatible types - from
'int (__cdecl *)(void *,MHD_ValueKind,const char *,const char *)' to
'MHD_KeyValueIterator'

Right now I am building with Visual Studio 2008  but I get the same
warnings with Visual Studio 2019.

I'm sure there is a simple solution but I have not figured it out.

Here are my callback prototypes...

   int
   AccessHandlerCallback
   (
     void* cls,
     struct MHD_Connection* connection,
     const char* url,
     const char* method,
     const char* version,
     const char* upload_data,
     size_t* upload_data_size,
     void** con_cls
   );

   int
   AcceptPolicyCallback
   (
     void* cls,
     const struct sockaddr* addr,
     socklen_t addrlen
   );

   int
   PostDataIterator
   (
     void* coninfo_cls,
     enum MHD_ValueKind kind,
     const char* key,
     const char* filename,
     const char* content_type,
     const char* transfer_encoding,
     const char* data,
     uint64_t off,
     size_t size
   );

   int
   KeyValueIterator
   (
     void* cls,
     enum MHD_ValueKind kind,
     const char* key,
     const char* value
   );

Thanks,

Chris


 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]