Test::Harness 2.22 -> 2.23
[p5sagit/p5-mst-13.2.git] / ext / Socket / Socket.xs
index b302eaa..d844775 100644 (file)
@@ -3,6 +3,8 @@
 #include "perl.h"
 #include "XSUB.h"
 
+#include <stddef.h>
+
 #ifndef VMS
 # ifdef I_SYS_TYPES
 #  include <sys/types.h>
@@ -209,11 +211,11 @@ not_here(char *s)
 *
 * --jhi */
 
-#include "constants.c"
+#include "const-c.inc"
 
 MODULE = Socket                PACKAGE = Socket
 
-INCLUDE: constants.xs
+INCLUDE: const-xs.inc
 
 void
 inet_aton(host)
@@ -261,8 +263,9 @@ inet_ntoa(ip_address_sv)
                      addrlen, sizeof(addr));
        /* We could use inet_ntoa() but that is broken
         * in HP-UX + GCC + 64bitint (returns "0.0.0.0"),
-        * so let's use this sprintf() workaround everywhere. */
-       New(1138, addr_str, 4 * 3 + 3 + 1, char);
+        * so let's use this sprintf() workaround everywhere.
+        * This is also more threadsafe than using inet_ntoa(). */
+       New(1138, addr_str, 4 * 3 + 3 + 1, char); /* IPv6? */
        sprintf(addr_str, "%d.%d.%d.%d",
                ((addr.s_addr >> 24) & 0xFF),
                ((addr.s_addr >> 16) & 0xFF),