sources/main.cpp

branch
protocol5
changeset 106
7b156b764d11
parent 93
1ea012a6e1ec
child 109
e4966d7e615d
--- a/sources/main.cpp	Sat Jan 09 02:35:00 2016 +0200
+++ b/sources/main.cpp	Sat Jan 09 17:41:21 2016 +0200
@@ -28,26 +28,26 @@
 	SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include "main.h"
-
 #ifndef _WIN32
 # include <sys/select.h>
 #else
 # include <winsock2.h>
 #endif
 
-#include <time.h>
+#include "main.h"
 #include "network/rconsession.h"
 #include "huffman.h"
 #include "interface.h"
 
 // -------------------------------------------------------------------------------------------------
 //
-FUNCTION
-main (int argc, char* argv[]) -> int
+int main (int argc, char* argv[])
 {
 #ifdef _WIN32
+# ifdef HAVE_PDCURSES_WIN32A
+	// PDCurses-win32a uses a GUI window of its own so we need to destroy the console window.
 	FreeConsole();
+# endif
 
 	WSADATA wsaData;
 	int result = WSAStartup (MAKEWORD (2, 2), &wsaData);
@@ -67,7 +67,7 @@
 		return EXIT_FAILURE;
 	}
 
-	Interface iface;
+	zfc::Interface iface;
 
 	if (argc == 3)
 		iface.connect (argv[1], argv[2]);
@@ -85,7 +85,7 @@
 			FD_SET (0, &fdset);
 
 			int fd = iface.get_session()->socket()->file_descriptor();
-			highest = max (highest, fd);
+			highest = zfc::max (highest, fd);
 			FD_SET (fd, &fdset);
 
 			select (highest + 1, &fdset, nullptr, nullptr, &timeout);
@@ -100,7 +100,7 @@
 			iface.render();
 		}
 	}
-	catch (const Exitception&) {}
+	catch (const zfc::Exitception&) {}
 
 	iface.get_session()->disconnect();
 	return EXIT_SUCCESS;

mercurial