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.
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);
u_short
win32_htons(u_short hostshort)
{
-#ifdef MYSWAP
- dTHX;
-#else
+#ifndef WIN32_NO_SOCKETS
StartSockets();
#endif
return htons(hostshort);
u_long
win32_ntohl(u_long netlong)
{
-#ifdef MYSWAP
- dTHX;
-#else
+#ifndef WIN32_NO_SOCKETS
StartSockets();
#endif
return ntohl(netlong);
u_short
win32_ntohs(u_short netshort)
{
-#ifdef MYSWAP
- dTHX;
-#else
+#ifndef WIN32_NO_SOCKETS
StartSockets();
#endif
return ntohs(netshort);