From: Artur Bergman Date: Wed, 29 Aug 2001 19:01:47 +0000 (+0000) Subject: GCC on HP-UX 11 with 64bit support breaks inet_ntoa X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=df8513ebccb346c715b201053776d8f657fee6c9;p=p5sagit%2Fp5-mst-13.2.git GCC on HP-UX 11 with 64bit support breaks inet_ntoa This is a replacement implmentation that works on HPUX. This bug should probably be fixed in GCC. p4raw-id: //depot/perl@11789 --- diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 2a37542..67f5279 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -221,8 +221,13 @@ inet_ntoa(ip_address_sv) } Copy( ip_address, &addr, sizeof addr, char ); +#if defined(__hpux) && defined(__GNUC__) && defined(USE_64_BIT_INT) + /* GCC on HP_UX breaks the call to inet_ntoa, // sky*/ + addr_str = (char *) malloc(16); + sprintf(addr_str, "%d.%d.%d.%d", ((addr.s_addr >> 24) & 0xFF) , ((addr.s_addr >> 16) & 0xFF), ((addr.s_addr >> 8) & 0xFF), (addr.s_addr & 0xFF)); +#else addr_str = inet_ntoa(addr); - +#endif ST(0) = sv_2mortal(newSVpvn(addr_str, strlen(addr_str))); }