Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 21752
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: alexchorny [...] gmail.com
andy.melnikov [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Patch: error in compiler detection, error in XS.
ActiveState perl v5.8.7 built for MSWin32-x86-multi-thread Binary build 813 Also ok on Vanilla, Cygwin. ------- Alexandr Ciornii, http://chorny.net
Subject: Makefile.PL.patch
--- Makefile.PL.dist Mon Sep 18 22:22:12 2006 +++ Makefile.PL Wed Sep 27 01:38:46 2006 @@ -211,6 +211,7 @@ +use Config qw(%Config); sub postamble { my $content; @@ -222,8 +223,9 @@ -netdns$(LIB_EXT): netdns.o - $(AR) cr netdns$(LIB_EXT) netdns.o +netdns$(LIB_EXT): netdns$(OBJ_EXT) + $(AR) '.($^O eq 'MSWin32' && $Config{'cc'} eq 'cl'?'/OUT:':'cr '). + 'netdns$(LIB_EXT) netdns$(OBJ_EXT) $(RANLIB) netdns$(LIB_EXT)
Subject: netdns.h.patch
--- netdns.h.dist Mon Sep 18 22:22:12 2006 +++ netdns.h Wed Sep 27 01:36:26 2006 @@ -1,4 +1,7 @@ #include <sys/types.h> +#if defined(_MSC_VER) || defined(__MINGW32_VERSION) +#include <windows.h> +#endif #define TESTVAL 4 extern double foo(int, long, const char*);
Subject: Re: [rt.cpan.org #21752] Patch: error in compiler detection, error in XS.
Date: Thu, 28 Sep 2006 16:36:40 +0200
To: bug-Net-DNS [...] rt.cpan.org
From: "Olaf M. Kolkman" <olaf [...] dacht.net>
Patch applied on the trunk. I have no ways to test this. --Olaf On 27Sep 2006, at 8:43 PM, alexchorny@gmail.com via RT wrote: Show quoted text
> > Wed Sep 27 14:43:23 2006: Request 21752 was acted upon. > Transaction: Ticket created by alexchorny@gmail.com > Queue: Net-DNS > Subject: Patch: error in compiler detection, error in XS. > Broken in: (no value) > Severity: Normal > Owner: Nobody > Requestors: alexchorny@gmail.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=21752 > > > > ActiveState perl v5.8.7 built for MSWin32-x86-multi-thread > Binary build 813 > > Also ok on Vanilla, Cygwin. > > ------- > Alexandr Ciornii, http://chorny.net > > <Makefile.PL.patch> > <netdns.h.patch>
------------------------------------------------------ Ik dacht net... heel even maar.
Download PGP.sig
application/pgp-signature 227b

Message body not shown because it is not plain text.

Subject: netdns.c doesn't compile on Win32/Visual C++ due to u_char
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.
From: andy.melnikov [...] gmail.com
alexchorny@gmail.com wrote: --- netdns.h.dist Mon Sep 18 22:22:12 2006 +++ netdns.h Wed Sep 27 01:36:26 2006 @@ -1,4 +1,7 @@ #include <sys/types.h> +#if defined(_MSC_VER) || defined(__MINGW32_VERSION) +#include <windows.h> +#endif #define TESTVAL 4 extern double foo(int, long, const char*); Just a single typedef unsigned char u_char; is enough here instead of fat windows.h. Also, IMO winsock2.h would still be a better alternative if you want to include a header for some reason instead of copy/pasting the standard BSD definition.
From: OLAF [...] cpan.org
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: Show quoted text
> 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.
From: andy.melnikov [...] gmail.com
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. > >
So just to be sure; looking at those variables that Alexandr suggested will not break anything. Or is just looking at WIN32 prefered? This is what I have now: #include <sys/types.h> #if defined(_MSC_VER) || defined(__MINGW32_VERSION) typedef unsigned char u_char; #endif
So just to be sure; looking at those variables that Alexandr suggested will not break anything. Or is just looking at WIN32 prefered? This is what I have now: #include <sys/types.h> #if defined(_MSC_VER) || defined(__MINGW32_VERSION) typedef unsigned char u_char; #endif
From: jloverso [...] mathworks.com
Just to let you know, I'm sucessfully building and using Net-DNS 0.59 on Windows (and Linux, Sol 5.10 and Mac 10.4) with the current trunk versions of netdns.h and Makefile.PL; which include the fixes for this bug as well as the fix for 22334 (netdns.a not built when XS forced). Perhaps you could release an 0.60? Thanks.
Show quoted text
> Perhaps you could release an 0.60? Thanks.
0.60 was released last week