瀏覽代碼

* VCMI works again on Windows.

hint: ./executable.exe does not run executable on Windows - you must use executable.exe or .\executable.exe
mateuszb 16 年之前
父節點
當前提交
fdcb286044
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 1 1
      client/Client.cpp
  2. 6 0
      global.h

+ 1 - 1
client/Client.cpp

@@ -371,7 +371,7 @@ void CClient::newGame( CConnection *con, StartInfo *si )
 
 void CClient::runServer(const char * portc)
 {
-	static std::string comm = std::string(BIN_DIR "/" SERVER_NAME " ") + portc + " > server_log.txt"; //needs to be static, if not - will be probably destroyed before new thread reads it
+	static std::string comm = std::string(BIN_DIR PATH_SEPARATOR SERVER_NAME " ") + portc + " > server_log.txt"; //needs to be static, if not - will be probably destroyed before new thread reads it
 	boost::thread servthr(boost::bind(system,comm.c_str())); //runs server executable; 	//TODO: will it work on non-windows platforms?
 }
 

+ 6 - 0
global.h

@@ -50,6 +50,12 @@ extern std::string NAME_AFFIX; //client / server
 #define SERVER_NAME "vcmiserver"
 #endif
 
+#ifdef _WIN32
+#define PATH_SEPARATOR "\\"
+#else
+#define PATH_SEPARATOR "/"
+#endif
+
 /*
  * global.h, part of VCMI engine
  *