Drop backtrace generation.

This has been completely broken since 2018 (commit a93283df), and no
one noticed, so it probably wasn't useful. Instead of fixing it, just
drop the feature and a bunch of odd nonportable code.
This commit is contained in:
whitequark 2020-07-28 14:56:55 +00:00
parent bbf402bfe3
commit d8b76ef7f1
3 changed files with 0 additions and 29 deletions

View File

@ -6,11 +6,6 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR})
set(HAVE_BACKTRACE ${Backtrace_FOUND})
if(HAVE_BACKTRACE)
set(BACKTRACE_HEADER <${Backtrace_HEADER}>)
endif()
set(HAVE_SPACEWARE ${SPACEWARE_FOUND})
if(NOT WIN32 OR APPLE)

View File

@ -12,10 +12,6 @@
/* What OpenGL version do we use? */
#define HAVE_OPENGL @OPENGL@
/* Do we have backtrace() function, and if yes, in which library? */
#cmakedefine HAVE_BACKTRACE
#define BACKTRACE_HEADER @BACKTRACE_HEADER@
/* If we use GTK, can we use the native file chooser? */
#cmakedefine HAVE_GTK_FILECHOOSERNATIVE

View File

@ -24,26 +24,6 @@ namespace Platform {
void FatalError(const std::string &message) {
fprintf(stderr, "%s", message.c_str());
#if !defined(LIBRARY) && defined(HAVE_BACKTRACE)
static void *ptrs[1024] = {};
size_t nptrs = backtrace(ptrs, sizeof(ptrs) / sizeof(ptrs[0]));
char **syms = backtrace_symbols(ptrs, nptrs);
fprintf(stderr, "Backtrace:\n");
if(syms != NULL) {
for(size_t i = 0; i < nptrs; i++) {
fprintf(stderr, "%2zu: %s\n", i, syms[i]);
}
} else {
for(size_t i = 0; i < nptrs; i++) {
fprintf(stderr, "%2zu: %p\n", i, ptrs[i]);
}
}
#else
fprintf(stderr, "Backtrace support not compiled in.\n");
#endif
abort();
}