diff options
author | Artur Bergman <sky@nanisky.com> | 2001-08-29 19:01:47 +0000 |
---|---|---|
committer | Artur Bergman <sky@nanisky.com> | 2001-08-29 19:01:47 +0000 |
commit | df8513ebccb346c715b201053776d8f657fee6c9 (patch) | |
tree | 0c0d228b786d81b729511d170b118e6ac6b0d82c /ext/Socket/Socket.xs | |
parent | 59d8ce6297a94889161c3324ccfdc9bb1a2d9d05 (diff) | |
download | perl-df8513ebccb346c715b201053776d8f657fee6c9.tar.gz |
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
Diffstat (limited to 'ext/Socket/Socket.xs')
-rw-r--r-- | ext/Socket/Socket.xs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 2a37542526..67f52799d0 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))); } |