|From:||Carlos Henrique Júnior|
|Subject:||Re: [libmicrohttpd] Re: ITALY - memory pool (2)|
|Date:||Sun, 19 Sep 2010 18:47:42 -0300|
On Wednesday 15 September 2010 17:39:41 address@hidden wrote:I think this should be done using macros instead of function pointers.
> Second step: I have to port the MHD library on a generic embedded platform.
> What I would do is:
> - Replace all the POSIX calls in the code with function pointers
> - Write an MHD_config (mhd_conf_t *conf) function, where the caller
> passes the address of the actual function
> In this way the code can be compiled on any platform/compiler and we leave
> the end user to implement the actual functions.
> In principle, one can replace the TCP/IP stack with a RS232 stack as a
> transport layer.
Function pointers will confuse existing tools (such as static analysis tools)
and make the code harder to read for a feature that most users won't need.
We've used the macro approach to provide a POSIX-like API for W32 systems and
it worked quite well (PlibC). Also, if you use macros, your C compiler will
likely be able to do a better job optimizing your code (especially for your
I don't see a problem with having another build file --- however, I won't be
> That's the way I did it when I ported the FreeDOS FAT 16 filesystem.
> I see here also another smaller problem: the ordinary Windows user doesn't
> know how to build the code with Cygwin.
> I would add a separate project file for MSVC.
> What do you think?
able to maintain it (no MSVC here...). Still, even a slightly outdated build
file might be better than nothing for some users.
|[Prev in Thread]||Current Thread||[Next in Thread]|