mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Android port.
Conflicts: lib/vcmi_endian.h
This commit is contained in:
committed by
Ilya Zhuravlev
parent
ccc5c69fa2
commit
db7cd79cf7
@@ -19,7 +19,9 @@
|
||||
#include "CVCMIServer.h"
|
||||
#include "../lib/StartInfo.h"
|
||||
#include "../lib/mapping/CMap.h"
|
||||
#ifndef __ANDROID__
|
||||
#include "../lib/Interprocess.h"
|
||||
#endif
|
||||
#include "../lib/VCMI_Lib.h"
|
||||
#include "../lib/VCMIDirs.h"
|
||||
#include "CGameHandler.h"
|
||||
@@ -32,7 +34,7 @@
|
||||
|
||||
#include "../lib/UnlockGuard.h"
|
||||
|
||||
#if defined(__GNUC__) && !defined (__MINGW32__)
|
||||
#if defined(__GNUC__) && !defined (__MINGW32__) && !defined(__ANDROID__)
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
@@ -41,7 +43,9 @@ std::string NAME = GameConstants::VCMI_VERSION + std::string(" (") + NAME_AFFIX
|
||||
using namespace boost;
|
||||
using namespace boost::asio;
|
||||
using namespace boost::asio::ip;
|
||||
#ifndef __ANDROID__
|
||||
namespace intpr = boost::interprocess;
|
||||
#endif
|
||||
bool end2 = false;
|
||||
int port = 3030;
|
||||
|
||||
@@ -391,6 +395,7 @@ void CVCMIServer::newPregame()
|
||||
|
||||
void CVCMIServer::start()
|
||||
{
|
||||
#ifndef __ANDROID__
|
||||
ServerReady *sr = nullptr;
|
||||
intpr::mapped_region *mr;
|
||||
try
|
||||
@@ -407,13 +412,16 @@ void CVCMIServer::start()
|
||||
mr = new intpr::mapped_region(smo,intpr::read_write);
|
||||
sr = new(mr->get_address())ServerReady();
|
||||
}
|
||||
#endif
|
||||
|
||||
boost::system::error_code error;
|
||||
logNetwork->infoStream()<<"Listening for connections at port " << acceptor->local_endpoint().port();
|
||||
auto s = new tcp::socket(acceptor->get_io_service());
|
||||
boost::thread acc(boost::bind(vaccept,acceptor,s,&error));
|
||||
#ifndef __ANDROID__
|
||||
sr->setToTrueAndNotify();
|
||||
delete mr;
|
||||
#endif
|
||||
|
||||
acc.join();
|
||||
if (error)
|
||||
@@ -554,7 +562,7 @@ static void handleCommandOptions(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && !defined (__MINGW32__)
|
||||
#if defined(__GNUC__) && !defined (__MINGW32__) && !defined(__ANDROID__)
|
||||
void handleLinuxSignal(int sig)
|
||||
{
|
||||
const int STACKTRACE_SIZE = 100;
|
||||
@@ -585,7 +593,7 @@ int main(int argc, char** argv)
|
||||
{
|
||||
// Installs a sig sev segmentation violation handler
|
||||
// to log stacktrace
|
||||
#if defined(__GNUC__) && !defined (__MINGW32__)
|
||||
#if defined(__GNUC__) && !defined (__MINGW32__) && !defined(__ANDROID__)
|
||||
signal(SIGSEGV, handleLinuxSignal);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user