Re: [xml] Win32 porting

Date view Thread view Subject view Author view

From: Peter Jacobi (pj@walter-graphtek.com)
Date: Tue Dec 21 1999 - 16:45:37 EST


Daniel Veillard commenting on my post:
> > nt isinf (double d) {
>
> I assume that's a cut'n paste problem and actually this line reads
>
> static int isinf (double d) {
>
> right ?

Yes

> > C) In the sys directory relative to the compiler default include
> > directory I put a dummy socket.h:
> > #include <winsock2.h>
> > #define EWOULDBLOCK WSAEWOULDBLOCK
> [more #define removed]
>
> Well this seems rather fragile, can't we just remove HAVE_SYS_SOCKET_H
> and include this right away in win32config.h instead ?
> The only include of <sys/socket.h> is in nanohttp.c and is protected
> by HAVE_SYS_SOCKET_H,

When putting it into win32config.h, it will be included in every source
file and so it will include winsock2.h and that will include zillions of
lines of obscure Microsoft Windows headers in each .c file.

Even if this doesn't break the code due to polluting the global
namespace with MS stuff, it's a terrible waste.

But I agree not everybody would like to modify the compiler's include
directories. Perhaps in nanohttp.h it should read:

#ifdef WIN32
#define INCLUDE_WINSOCK
#include "win32config.h"
#else

and in win32config.h:

#ifdef INCLUDE_WINSOCK
#include <winsock2.h>
#define EWOULDBLOCK WSAEWOULDBLOCK
[more #define removed]
#endif

Regards,
Peter

----
Message from the list xml@xmlsoft.org
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@xmlsoft.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:29:56 EDT