libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Introducing a LMH version check in a configure.ac


From: emmanuel
Subject: Re: [libmicrohttpd] Introducing a LMH version check in a configure.ac
Date: Fri, 22 Jan 2010 12:35:22 +0100

Thank you Christian, you helped me a lot.
This is code I have done to check libmicrohttpd version:

       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                                        #include <stdint.h>
                                        #include <stdlib.h>
                                        #include <stdio.h>
                                        #include <unistd.h>
                                        #include <microhttpd.h>
                                        ]],
                                        [[
                                        #if MHD_VERSION >= 0x00040000
                                        // MHD_VERSION is high enough
                                        #else
                                        #  MHD_VERSION is to low
                                        #endif
                                        ]])],
                                        [], [AC_MSG_ERROR([[The libmicrohttpd 
version must be 0.4.0 or higher.]])])

Regards
Emmanuel

 Le mer 20/01/10 14:15, "Christian Grothoff" address@hidden a écrit:
> Dear Emmanuel,
> 
> If MHD_VERSION is larger or equal to 0x00040000 you have version 0.4.0 or
> higher.  Basically, if MHD is version A.B.C then the numeric values of
> A/B/C converted to hex will be used for MHD_VERSION (0xAABBCC00).  The last 
> '00'
> can be changed to indicate changes in SVN (unreleased) or for minor versions
> (i.e. 0.4.5a might mean that the last '00' is changed to some number greater 
> 0 to
> indicate the 'a' variant).
> 
> Best,
> 
> Christian
> 
> On Wednesday 20 January 2010 10:40:43 emmanu> address@hidden wrote:
> Hi,
> > 
> > I use libmicrohttpd in my project and it works well,
> it does exactly what
>  it has to do.
> > 
> > Unfortunately, my soft does not compile on "old"
> GNU/Linux distributions. I
>  get this error:
> > 
> > file.cpp:279: erreur: invalid conversion from «int
> (*)(void*,
>  MHD_Connection*, const char*, const char*, const
> char*, const char*,
>  size_t*, void**)» to «int (*)(void*,
> MHD_Connection*, const char*, const
>  char*, const char*, const char*, unsigned int*,
> void**)»
> 
> > file.cpp:279: erreur:   initialising argument 5 of
> «MHD_Daemon*
>  MHD_start_daemon(unsigned int, short unsigned int,
> int (*)(void*, const
>  sockaddr*, socklen_t), void*, int (*)(void*,
> MHD_Connection*, const char*,
>  const char*, const char*, const char*, unsigned
> int*, void**), void*,
>  ...)»
> > 
> > It seems that the API was changed at the version
> 0.4.0 and in fact it works
>  well with a recent version of LMH. I want now to
> check that (the LMH
>  version) in my configure.ac: I want to be certain
> that the system has a
>  version of LMH at least higher than the
> 0.4.0.
> 
> > How I can do that? I have seen MHD_VERSION in
> microhttpd.h but I do not
>  understand how to make the relation between this
> hex. number and the human
>  readable version numbers (like 0.4.0).
> > 
> > Regards
> > Emmmanuel
> > 
> 
> -- 
> http://grothoff.org/christian/
> 
> 





reply via email to

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