Re: [xml] Building libxml2 as a DLL under MinGW MSYS



Igor Zlatkovic <igor stud fh-frankfurt de> writes:

and Elizabeth has the same. Now, when compiling the source, how can
one know that you two need config.h and I need win32config.h?

Autoconf defines the HAVE_CONFIG_H and that is what I was using in
nanahttp.c to determine whether or not include it.

How about using the win32config.h as a source for the config.h
hereforth? I mean, make the source always include config.h. GNU
autoconf's ./configure then generates it from config.h.in, and
./win32/configure.js generates it by making a copy of win32config.h.

Is that an option?

(after re-reading what you wrote I understand this better but the
following has been kept in, in case it is useful)...

I'm now wondering if the defines that re-define the error conditions
of Winsock to those of posix should go into config.h because config.h
is mostly things like:

#define HAVE_STDLIB_H

What about if the VC users *not* define HAVE_CONFIG_H (which they
don't) and, say in nanohttp.c do something like:

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#ifdef __WIN32__
#include <winsock2.h>
#include <win32config.h>
#endif

and in win32config.h, test for HAVE_CONFIG_H; if it's not defined,
then set the defaults, the isnan, etc, but include the socket error
codes regardless if they're not defined - that probably is the best
place for them (that is, not in the source file).

...

Oh, I see, you mean that even the VC group would use config.h. That's
certainly a good idea, although, again I wonder if the various
#define's that represent winsock error messages should go within it
and would be better suited in their own file so as to decouple the
configure information from the portability macros.

What is your opinion on that?

Elizabeth






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