From ea271d967c52892a61f2b2db754780912e0f7cef Mon Sep 17 00:00:00 2001 From: Pixel Date: Mon, 17 Oct 2011 23:06:29 -0700 Subject: Making some adjustments to get the Socket code compiling under mingw32. Doesn't work though; I'm guessing IPv6 isn't really mingw32 thing. At least, it's not WinXP's. Will try later to make something that switches between IPv4 and IPv6 intelligently. --- includes/Printer.h | 8 ++++++++ includes/Socket.h | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/Printer.h b/includes/Printer.h index cd24059..e8d9a03 100644 --- a/includes/Printer.h +++ b/includes/Printer.h @@ -20,6 +20,14 @@ enum { M_MAX = M_ENGINE_DEBUG, }; +#undef E_STRING +#undef E_TASK +#undef E_EVENT +#undef E_HANDLE +#undef E_INPUT +#undef E_SOCKET +#undef E_THREAD + enum { E_STRING = 1, E_TASK = 2, diff --git a/includes/Socket.h b/includes/Socket.h index 1f20fbb..b762d9b 100644 --- a/includes/Socket.h +++ b/includes/Socket.h @@ -1,6 +1,12 @@ #pragma once +#ifdef _WIN32 +#include +#include +#include +#else #include +#endif #include #include #include @@ -53,7 +59,8 @@ class Listener : public Task { public: Listener(int port, const char * local = NULL) : m_stop(false) { m_listener.setLocal(local, port); - m_listener.listen(); + bool r = m_listener.listen(); + Assert(r); m_name = String(ClassName(this).c_str()) + " - " + m_listener.getName(); Printer::elog(E_SOCKET, "Created a listener task at %p", this); } -- cgit v1.2.3