summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-17 23:06:29 -0700
committerPixel <pixel@nobis-crew.org>2011-10-17 23:06:57 -0700
commitea271d967c52892a61f2b2db754780912e0f7cef (patch)
tree9cc70e5adfb75699291471ff4a5a6e9532c0002c /includes
parent58f4ba6c8a4f9662dad9f5ddb3106c2e2c34daa6 (diff)
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.
Diffstat (limited to 'includes')
-rw-r--r--includes/Printer.h8
-rw-r--r--includes/Socket.h9
2 files changed, 16 insertions, 1 deletions
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 <windows.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
#include <netdb.h>
+#endif
#include <Handle.h>
#include <Task.h>
#include <Printer.h>
@@ -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);
}