#include <signal.h>
#include <sys/types.h>
+#include "../lib/libwebsockets.h"
+
#ifndef _WIN32
#include <netdb.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <poll.h>
#include <unistd.h>
+#else
+#include "gettimeofday.h"
#endif
-#include "../lib/libwebsockets.h"
-
/*
* this is specified in the 04 standard, control frames can only have small
* payload length styles
{ NULL, 0, 0, 0 }
};
-#ifndef WIN32
+#ifndef _WIN32
static void
signal_handler(int sig, siginfo_t *si, void *v)
{
struct libwebsocket_context *context;
char protocol_name[256];
char ip[30];
-#ifndef WIN32
+#ifndef _WIN32
struct sigaction sa;
struct winsize w;
#endif
}
}
-#ifndef WIN32
+#ifndef _WIN32
if (isatty(STDOUT_FILENO))
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1)
if (w.ws_col > 0)
fprintf(stderr, "Websocket PING %s (%s) %d bytes of data.\n",
peer_name, ip, size);
-#ifndef WIN32
+#ifndef _WIN32
/* set the ^C handler */
sa.sa_sigaction = signal_handler;
sa.sa_flags = SA_SIGINFO;