From 2e47f002aff970ee1dd0a22c88febd5682ed2482 Mon Sep 17 00:00:00 2001
From: senator <senator>
Date: Mon, 24 Mar 2008 14:21:34 +0000
Subject: win32 compatibility for sleep function in sendrecieve.cc

---
 client/client.pro     | 4 ++++
 client/sendrecieve.cc | 9 ++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/client/client.pro b/client/client.pro
index 8989180..3ab8855 100644
--- a/client/client.pro
+++ b/client/client.pro
@@ -36,3 +36,7 @@ SOURCES += main.cc sendrecieve.cc macro.cc builder.cc \
         widgets/checkbox.cc \
         widgets/window.cc
 QT += core gui network xml
+
+win32 {
+	DEFINES += HOST_WIN32
+}
diff --git a/client/sendrecieve.cc b/client/sendrecieve.cc
index 8b4732b..0a664eb 100644
--- a/client/sendrecieve.cc
+++ b/client/sendrecieve.cc
@@ -35,6 +35,13 @@
 #include <QByteArray>
 #include <QSettings>
 
+#ifdef HOST_WIN32
+#include <windows.h>
+#define sleep(x) Sleep(x * 1000)
+#else
+#include <unistd.h>
+#endif
+
 SendRecieve::SendRecieve()
   : QObject()
 {
@@ -63,7 +70,7 @@ void SendRecieve::tcpDisconnect()
       tcpConnected = TCP_DISCONNECTED;
       return;
     }
-    usleep(5000);
+    sleep(1);
     printf("ERROR!!! Couldn't connect to host!\n");
     qApp->processEvents();
   }
-- 
cgit v1.2.3