From fef637bdab85fef50d54d985e9c254dbca289d99 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 26 Mar 2018 21:25:40 -0700 Subject: Get Windows build working again. MegaWiFi code probably needs more work before it will actually work on Windows, but at least it doesn't break the build now --- megawifi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'megawifi.c') diff --git a/megawifi.c b/megawifi.c index 00691f3..e5ba7b7 100644 --- a/megawifi.c +++ b/megawifi.c @@ -2,9 +2,15 @@ #include #include #include +#ifdef _WIN32 +#define WINVER 0x501 +#include +#include +#else #include #include #include +#endif #include #include #include "genesis.h" @@ -125,7 +131,10 @@ static void poll_socket(megawifi *mw, uint8_t channel) int res = accept(mw->sock_fds[channel], NULL, NULL); if (res >= 0) { close(mw->sock_fds[channel]); +#ifndef _WIN32 +//FIXME: Set nonblocking on Windows too fcntl(res, F_SETFL, O_NONBLOCK); +#endif mw->sock_fds[channel] = res; mw->channel_state[channel] = 2; mw->channel_flags |= 1 << (channel + 1); @@ -284,7 +293,10 @@ static void process_packet(megawifi *mw) } else { mw->channel_flags |= 1 << (channel + 1); mw->channel_state[channel] = 1; +#ifndef _WIN32 +//FIXME: Set nonblocking on Windows too fcntl(mw->sock_fds[channel], F_SETFL, O_NONBLOCK); +#endif } end_reply(mw); break; -- cgit v1.2.3