From: Michael Jumper Date: Thu, 10 Feb 2011 09:17:31 +0000 (-0800) Subject: Thread support for MinGW32 X-Git-Url: http://git.alex.org.uk Thread support for MinGW32 --- diff --git a/src/daemon.c b/src/daemon.c index 19f0b5d..bdc0a0d 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -34,6 +34,9 @@ #ifdef __HAVE_PTHREAD_H__ #include +#elif defined(__MINGW32) +#include +#include #endif #include @@ -209,8 +212,14 @@ int main(int argc, char* argv[]) { GUAC_LOG_ERROR("Could not create client thread: %s", lasterror()); return 3; } +#elif __MINGW32__ + if (_beginthread(start_client_thread, 0, (void*) data) == -1L) { + GUAC_LOG_ERROR("Could not create client thread: %s", lasterror()); + return 3; + } #else - GUAC_LOG_INFO("POSIX threads support not present at compile time."); +#warning THREAD SUPPORT NOT FOUND! guacd will only be able to handle one connection at a time. + GUAC_LOG_INFO("Thread support not present at compile time."); GUAC_LOG_INFO("guacd handling one connection at a time."); start_client_thread(data); #endif