void
start_sockets(void)
{
- dTHX;
unsigned short version;
WSADATA retdata;
int ret;
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);
struct servent *
win32_getservbyname(const char *name, const char *proto)
{
- dTHX;
+ dTHXa(NULL);
struct servent *r;
SOCKET_TEST(r = getservbyname(name, proto), NULL);
if (r) {
+ aTHXa(PERL_GET_THX);
r = win32_savecopyservent(&w32_servent, r, proto);
}
return r;
struct servent *
win32_getservbyport(int port, const char *proto)
{
- dTHX;
+ dTHXa(NULL);
struct servent *r;
SOCKET_TEST(r = getservbyport(port, proto), NULL);
if (r) {
+ aTHXa(PERL_GET_THX);
r = win32_savecopyservent(&w32_servent, r, proto);
}
return r;