#include "util/u_string.h"
#include <stdio.h>
-#if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
+#if defined(PIPE_OS_WINDOWS)
# include <winsock2.h>
# include <windows.h>
# include <ws2tcpip.h>
boolean
u_socket_init(void)
{
-#if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
+#if defined(PIPE_OS_WINDOWS)
WORD wVersionRequested;
WSADATA wsaData;
int err;
void
u_socket_stop(void)
{
-#if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
+#if defined(PIPE_OS_WINDOWS)
WSACleanup();
#endif
}
#if defined(PIPE_OS_UNIX)
shutdown(s, SHUT_RDWR);
close(s);
-#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
+#elif defined(PIPE_OS_WINDOWS)
shutdown(s, SD_BOTH);
closesocket(s);
#else
hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version
hints.ai_socktype = SOCK_STREAM;
- util_snprintf(portString, sizeof(portString), "%d", port);
+ snprintf(portString, sizeof(portString), "%d", port);
r = getaddrinfo(hostname, portString, NULL, &addr);
if (r != 0) {
fcntl(s, F_SETFL, old & ~O_NONBLOCK);
else
fcntl(s, F_SETFL, old | O_NONBLOCK);
-#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
+#elif defined(PIPE_OS_WINDOWS)
u_long iMode = block ? 0 : 1;
ioctlsocket(s, FIONBIO, &iMode);
#else