
perlbug-followup at perl
Sep 29, 2010, 8:05 AM
Post #1 of 17
(576 views)
Permalink
|
|
[perl #78132] [PATCH] Fix perl build problems on Stratus VOS
|
|
# New Ticket Created by Paul Green # Please include the string: [perl #78132] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=78132 > --- perl-current/Makefile.SH~ 2010-09-05 10:39:10.000000000 -0400 +++ perl-current/Makefile.SH 2010-09-14 00:49:48.000000000 -0400 @@ -555,7 +555,7 @@ .c.s: $(CCCMDSRC) -S $*.c -all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) miniperl $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make +all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make @echo " "; @echo " Everything is up to date. Type '$(MAKE) test' to run test suite." --- perl-current/ext/Socket/Socket.xs~ 2010-04-24 16:58:10.000000000 -0400 +++ perl-current/ext/Socket/Socket.xs 2010-09-13 17:07:15.000000000 -0400 @@ -465,22 +465,34 @@ CODE: #ifdef HAS_INETNTOP STRLEN addrlen, struct_size; +#ifdef AF_INET6 struct in6_addr addr; char str[INET6_ADDRSTRLEN]; +#else + struct in_addr addr; + char str[INET_ADDRSTRLEN]; +#endif char *ip_address = SvPV(ip_address_sv, addrlen); - if(af == AF_INET) { - struct_size = sizeof(struct in_addr); - } else if(af == AF_INET6) { - struct_size = sizeof(struct in6_addr); - } else { - croak("Bad address family for %s, got %d, should be either AF_INET or AF_INET6", + struct_size = sizeof(addr); + + if(af != AF_INET +#ifdef AF_INET6 + && af != AF_INET6 +#endif + ) { + croak("Bad address family for %s, got %d, should be" +#ifdef AF_INET6 + " either AF_INET or AF_INET6", +#else + " AF_INET", +#endif "Socket::inet_ntop", af); } Copy( ip_address, &addr, sizeof addr, char ); - inet_ntop(af, &addr, str, INET6_ADDRSTRLEN); + inet_ntop(af, &addr, str, sizeof str); ST(0) = newSVpvn_flags(str, strlen(str), SVs_TEMP); #else @@ -494,9 +506,23 @@ CODE: #ifdef HAS_INETPTON int ok; - struct in6_addr ip_address; - if(af != AF_INET && af != AF_INET6) { - croak("Bad address family for %s, got %d, should be either AF_INET or AF_INET6", +#ifdef AF_INET6 + struct in6_addr ip_address; +#else + struct in_addr ip_address; +#endif + + if(af != AF_INET +#ifdef AF_INET6 + && af != AF_INET6 +#endif + ) { + croak("Bad address family for %s, got %d, should be" +#ifdef AF_INET6 + " either AF_INET or AF_INET6", +#else + " AF_INET", +#endif "Socket::inet_pton", af); } @@ -504,8 +530,7 @@ ST(0) = sv_newmortal(); if (ok) { - sv_setpvn( ST(0), (char *)&ip_address, - af == AF_INET6 ? sizeof(ip_address) : sizeof(struct in_addr) ); + sv_setpvn( ST(0), (char *)&ip_address, sizeof(ip_address) ); } #else ST(0) = (SV *)not_here("inet_pton");
|