summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-12 00:03:58 -0700
committerPixel <pixel@nobis-crew.org>2011-10-12 00:05:43 -0700
commitceb4347250d8394a2b4f5d1e634b42532f34c7d1 (patch)
tree748c9e171cb04f42b47a18e5b36d1695edac418a /src
parentd5ec579125ac11bd24cd9dcbeb2d4fe3baf53333 (diff)
Forgot mingw32-config.h. Also fixed a couple of bugs:
WSAStartup has to be called in win32 at startup. The TLS environment needs to be cleared when created.
Diffstat (limited to 'src')
-rw-r--r--src/TaskMan.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/TaskMan.cc b/src/TaskMan.cc
index ea9c0fb..3b715ce 100644
--- a/src/TaskMan.cc
+++ b/src/TaskMan.cc
@@ -16,6 +16,20 @@ Balau::TaskMan::TaskMan() : m_stopped(false) {
}
}
+#ifdef _WIN32
+class WinSocketStartup : public Balau::AtStart {
+ public:
+ WinSocketStartup() : AtStart(5) { }
+ virtual void doStart() {
+ WSADATA wsaData;
+ int r = WSAStartup(MAKEWORD(2, 0), &wsaData);
+ Assert(r == 0);
+ }
+};
+
+static WinSocketStartup wsa;
+#endif
+
Balau::TaskMan * Balau::TaskMan::getTaskMan() { return localTaskMan.get(); }
Balau::TaskMan::~TaskMan() {