mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: platform: remove support for glibc's backtrace(), as it's unused
This commit is contained in:
@@ -19,7 +19,3 @@ GNU General Public License for more details.
|
||||
int Sys_CrashDetailsLibbacktrace( int logfd, char *message, int len, size_t max_len );
|
||||
qboolean Sys_SetupLibbacktrace( const char *argv0 );
|
||||
|
||||
//
|
||||
// crash_glibc.c
|
||||
//
|
||||
int Sys_CrashDetailsExecinfo( int logfd, char *message, int len, size_t max_len );
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
crash_glibc.c - advanced crashhandler based on glibc's execinfo API
|
||||
Copyright (C) 2016 Mittorn
|
||||
Copyright (C) 2025 Alibek Omarov
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
// on Glibc (which potentially might not be only Linux) systems we
|
||||
// have backtrace() and backtrace_symbols() calls, which replace for us
|
||||
// platform-specific code
|
||||
#if HAVE_EXECINFO
|
||||
#include <execinfo.h>
|
||||
#include <signal.h>
|
||||
#include "common.h"
|
||||
#include "input.h"
|
||||
#include "crash.h"
|
||||
|
||||
int Sys_CrashDetailsExecinfo( int logfd, char *message, int len, size_t max_len )
|
||||
{
|
||||
void *addrs[16];
|
||||
int size = backtrace( addrs, sizeof( addrs ) / sizeof( addrs[0] ));
|
||||
char **syms = backtrace_symbols( addrs, size );
|
||||
|
||||
for( int i = 0; i < size && syms; i++ )
|
||||
{
|
||||
size_t symlen = Q_strlen( syms[i] );
|
||||
char ch = '\n';
|
||||
|
||||
write( logfd, syms[i], symlen );
|
||||
write( logfd, &ch, 1 );
|
||||
|
||||
write( STDERR_FILENO, syms[i], symlen );
|
||||
write( STDERR_FILENO, &ch, 1 );
|
||||
|
||||
len += Q_snprintf( message + len, max_len - len, "%2d: %s\n", i, syms[i] );
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
#endif // HAVE_EXECINFO
|
||||
@@ -153,4 +153,4 @@ qboolean Sys_SetupLibbacktrace( const char *argv0 )
|
||||
return g_bt_state != NULL && enable_libbacktrace;
|
||||
}
|
||||
|
||||
#endif // HAVE_EXECINFO
|
||||
#endif // HAVE_LIBBACKTRACE
|
||||
|
||||
@@ -61,14 +61,6 @@ static void Sys_Crash( int signal, siginfo_t *si, void *context )
|
||||
}
|
||||
#endif // HAVE_LIBBACKTRACE
|
||||
|
||||
#if HAVE_EXECINFO
|
||||
if( !detailed_message )
|
||||
{
|
||||
len = Sys_CrashDetailsExecinfo( logfd, message, len, sizeof( message ));
|
||||
detailed_message = true;
|
||||
}
|
||||
#endif // HAVE_EXECINFO
|
||||
|
||||
#if !XASH_DEDICATED
|
||||
IN_SetMouseGrab( false );
|
||||
#endif
|
||||
|
||||
@@ -9,13 +9,6 @@ from copy import copy
|
||||
|
||||
top = '.'
|
||||
|
||||
EXECINFO_TEST = '''#include <execinfo.h>
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
backtrace(0, 0);
|
||||
backtrace_symbols(0, 0);
|
||||
}'''
|
||||
|
||||
FFMPEG_CHECK_FRAGMENT='''
|
||||
#include <libswresample/swresample.h>
|
||||
#include <libavformat/avformat.h>
|
||||
@@ -152,8 +145,6 @@ def configure(conf):
|
||||
for i in frameworks :
|
||||
conf.check(features='c cprogram', framework=i, uselib_store=i, msg='Checking for %s framework' % i)
|
||||
|
||||
conf.check_cc(fragment=EXECINFO_TEST, msg='Checking for glibc backtrace()', mandatory=False, define_name='HAVE_EXECINFO')
|
||||
|
||||
conf.define('ENGINE_DLL', 1)
|
||||
conf.define_cond('XASH_ENGINE_TESTS', conf.options.ENGINE_TESTS)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user