mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-21 19:19:26 +02:00
Removed largely unused signal handling, fixes build with musl c library
This commit is contained in:
parent
1084da00df
commit
46ccd65080
@ -12,9 +12,9 @@
|
||||
#include "NotificationHandler.h"
|
||||
#include <SDL_video.h>
|
||||
#include <SDL_events.h>
|
||||
#include <SDL_syswm.h>
|
||||
|
||||
#if defined(VCMI_WINDOWS)
|
||||
#include <SDL_syswm.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
// Windows Header Files:
|
||||
|
@ -59,10 +59,6 @@
|
||||
|
||||
#include "../lib/CGameState.h"
|
||||
|
||||
#if defined(__GNUC__) && !defined(__UCLIBC__) && !defined(__MINGW32__) && !defined(VCMI_MOBILE)
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
template<typename T> class CApplyOnServer;
|
||||
|
||||
class CBaseForServerApply
|
||||
@ -999,33 +995,6 @@ ui8 CVCMIServer::getIdOfFirstUnallocatedPlayer() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && !defined(__UCLIBC__) && !defined(__MINGW32__) && !defined(VCMI_MOBILE)
|
||||
void handleLinuxSignal(int sig)
|
||||
{
|
||||
const int STACKTRACE_SIZE = 100;
|
||||
void * buffer[STACKTRACE_SIZE];
|
||||
int ptrCount = backtrace(buffer, STACKTRACE_SIZE);
|
||||
char * * strings;
|
||||
|
||||
logGlobal->error("Error: signal %d :", sig);
|
||||
strings = backtrace_symbols(buffer, ptrCount);
|
||||
if(strings == nullptr)
|
||||
{
|
||||
logGlobal->error("There are no symbols.");
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i = 0; i < ptrCount; ++i)
|
||||
{
|
||||
logGlobal->error(strings[i]);
|
||||
}
|
||||
free(strings);
|
||||
}
|
||||
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void handleCommandOptions(int argc, const char * argv[], boost::program_options::variables_map & options)
|
||||
{
|
||||
namespace po = boost::program_options;
|
||||
@ -1101,11 +1070,6 @@ int main(int argc, const char * argv[])
|
||||
// Correct working dir executable folder (not bundle folder) so we can use executable relative paths
|
||||
boost::filesystem::current_path(boost::filesystem::system_complete(argv[0]).parent_path());
|
||||
#endif
|
||||
// Installs a sig sev segmentation violation handler
|
||||
// to log stacktrace
|
||||
#if defined(__GNUC__) && !defined(__UCLIBC__) && !defined(__MINGW32__) && !defined(VCMI_MOBILE)
|
||||
signal(SIGSEGV, handleLinuxSignal);
|
||||
#endif
|
||||
|
||||
#ifndef VCMI_IOS
|
||||
console = new CConsoleHandler();
|
||||
|
Loading…
x
Reference in New Issue
Block a user