void-packages/srcpkgs/anura/patches/musl-stacktrace.patch
2015-11-07 07:03:03 +01:00

30 lines
835 B
Diff

Disable <execinfo.h> and backtrace(3) if not GNU libc
--- src/stacktrace.hpp 2015-11-03 09:17:30.000000000 +0100
+++ src/stacktrace.hpp 2015-11-06 11:03:32.001951469 +0100
@@ -5,7 +5,9 @@
#include <stdio.h>
#include <stdlib.h>
+#if defined(__GLIBC__)
#include <execinfo.h>
+#endif
#include <cxxabi.h>
#include "SDL.h"
@@ -13,6 +15,7 @@
/** Print a demangled stack backtrace of the caller function to FILE* out. */
static inline void print_stacktrace(unsigned int max_frames = 63)
{
+#if defined(__GLIBC__)
SDL_LogCritical(SDL_LOG_CATEGORY_APPLICATION, "%s\n", "stack trace:");
// storage array for stack trace address data
@@ -79,4 +82,7 @@
free(funcname);
free(symbollist);
+#else
+ SDL_LogCritical(SDL_LOG_CATEGORY_APPLICATION, "%s\n", "stack trace is not available for your architecture");
+#endif
}