Update the Win32 miniperl conditional compilation, for the htonl etc changes.
authorNicholas Clark <nick@ccl4.org>
Mon, 6 May 2013 06:20:57 +0000 (08:20 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 20 May 2013 19:19:42 +0000 (21:19 +0200)
As of commit 19253ae62cd13079 (Oct 2012), miniperl on Win32 avoids using
Winsock. The win32_* wrappers for htonl etc had used the pre-processor
macro MYSWAP to conditionally compile in the correct code. However, MYSWAP
was defined as a side effect of using the htonl etc wrappers in util.c,
which are no longer needed. Hence use the WIN32_NO_SOCKETS macro directly
in win32sck.c for the correct conditional compilation.

win32/win32sck.c

index aec01ba..3773f40 100644 (file)
@@ -81,15 +81,13 @@ start_sockets(void)
     wsock_started = 1;
 }
 
-/* in no sockets Win32 builds, this fowards to replacements in util.c, dTHX
- * is required
+/* in no sockets Win32 builds, these use the inline functions defined in
+ * perl.h
  */
 u_long
 win32_htonl(u_long hostlong)
 {
-#ifdef MYSWAP
-    dTHX;
-#else
+#ifndef WIN32_NO_SOCKETS
     StartSockets();
 #endif
     return htonl(hostlong);
@@ -98,9 +96,7 @@ win32_htonl(u_long hostlong)
 u_short
 win32_htons(u_short hostshort)
 {
-#ifdef MYSWAP
-    dTHX;
-#else
+#ifndef WIN32_NO_SOCKETS
     StartSockets();
 #endif
     return htons(hostshort);
@@ -109,9 +105,7 @@ win32_htons(u_short hostshort)
 u_long
 win32_ntohl(u_long netlong)
 {
-#ifdef MYSWAP
-    dTHX;
-#else
+#ifndef WIN32_NO_SOCKETS
     StartSockets();
 #endif
     return ntohl(netlong);
@@ -120,9 +114,7 @@ win32_ntohl(u_long netlong)
 u_short
 win32_ntohs(u_short netshort)
 {
-#ifdef MYSWAP
-    dTHX;
-#else
+#ifndef WIN32_NO_SOCKETS
     StartSockets();
 #endif
     return ntohs(netshort);