#include "private-libwebsockets.h"
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
#include <tchar.h>
#include <io.h>
#include <mstcpip.h>
int n;
char *p = (char *)buf;
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
for (n = 0; n < len; n++)
p[n] = (unsigned char)rand();
#else
{
int optval = 1;
socklen_t optlen = sizeof(optval);
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
unsigned long optl = 0;
#endif
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
#endif
/* We are nonblocking... */
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
ioctlsocket(fd, FIONBIO, &optl);
#else
fcntl(fd, F_SETFL, O_NONBLOCK);
#endif
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
#else
close(context->fd_random);
#endif
free(context);
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
WSACleanup();
#endif
}
context->last_timeout_check_s = 0;
context->user_space = info->user;
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
context->fd_random = 0;
#else
context->fd_random = open(SYSTEM_RANDOM_FILEPATH, O_RDONLY);
#endif
/* ignore SIGPIPE */
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
#else
signal(SIGPIPE, sigpipe_handler);
#endif
setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY,
(const void *)&opt, sizeof(opt));
- #ifdef WIN32
+ #if defined(WIN32) || defined(_WIN32)
opt = 0;
ioctlsocket(sockfd, FIONBIO, (unsigned long *)&opt);
#else
* to listen on port < 1023 we would have needed root, but now we are
* listening, we don't want the power for anything else
*/
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
#else
if (info->gid != -1)
if (setgid(info->gid))
fprintf(stderr, "%s%s", buf, line);
}
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
LWS_VISIBLE void lwsl_emit_syslog(int level, const char *line)
{
lwsl_emit_stderr(level, line);