Change 11789 by sky@sky-lab on 2001/08/29 19:01:47

        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.

Affected files ...

... //depot/perl/ext/Socket/Socket.xs#38 edit

Differences ...

==== //depot/perl/ext/Socket/Socket.xs#38 (text) ====
Index: perl/ext/Socket/Socket.xs
--- perl/ext/Socket/Socket.xs.~1~       Wed Aug 29 13:15:05 2001
+++ perl/ext/Socket/Socket.xs   Wed Aug 29 13:15:05 2001
@@ -221,8 +221,13 @@
        }
 
        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)));
        }
 
End of Patch.

Reply via email to