Works with the latest activeperl (5.8.x) and MS Visual C++ 2005.
But I think the patches described here are hacks rather than proper
implementations.
Microsoft used BSD sockets implementation initially for their IP stack,
so during porting they needed several standard declarations not found in
non-compliant MSVC sys/types.h header. But fixing the header would break
old code, so they decided to use a hack and added those declarations to
winsock.h instead:
/*
* Basic system type definitions, taken from the BSD file sys/types.h.
*/
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
(the comment is by Microsoft)
Winsock.h is included when windows.h is included. But actually we don't
need neither winsock.h nor windows.h - we need just this little hack
from Microsoft. So I think replacing #include <windows.h> with just
typedef unsigned char u_char;
would be a replacement of one hack with another. But obviously from my
variant it more clear and can be easier fixed if Microsoft would make
compliant headers some day.
Regarding the "^O Win32" patch to makefile.pl I also have a better
solution, so I will publish it later here.
On Птн. Дек. 22 05:20:47 2006, OLAF wrote:
Show quoted text> >
> Would you be willing to be so kind and test the version that is
> currently on the development
> trunk. I have very few means to test the windows environments
> properly.
>
> svn co
http://www.net-dns.org/svn/net-dns/trunk/ net-dns-trunk
>
> should do the trick.
>
> --Olaf
>
> On Thu Dec 21 19:14:39 2006, nimnul wrote:
> > In Net-DNS-0.59 distribution netdns.c refuses to compile on
> Win32/Visual
> > C++ (I tried 2005, but earlier versions should have the same
> problem).
> >
> > It's due to broken/non-compliant sys/types.h on Windows. u_char type
> is
> > not defined there, so you should add something like
> >
> > #ifdef _WIN32
> > typedef unsigned char u_char;
> > #endif
> >
> > I'm not sure what exactly you should detect (e.g. it might compile
> using
> > cygwin/gcc even without this patch), so maybe you should use other
> > condition.
> >
> > This patch alone doesn't make Net::DNS using the XS part on Windows
> due
> > to problems with makefile (I will post that issue as another bug)
> but
> > with this patch Makefile.PL starts to detect the compiler
> successfully.
>
>