summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2020-01-11 10:23:14 +0000
committerVincent Sanders <vince@kyllikki.org>2020-01-11 10:23:14 +0000
commitd71d2632b42c7253a2e6d873a78d4fb458036484 (patch)
tree8fe17642e84124e99c8f21c8fc0029e132a036df /frontends
parented6c326b1c6643a6f0516cf2e613eb85781ab5b6 (diff)
downloadnetsurf-d71d2632b42c7253a2e6d873a78d4fb458036484.tar.gz
netsurf-d71d2632b42c7253a2e6d873a78d4fb458036484.tar.bz2
limit monkey backtrace generation to libc where it is available
Diffstat (limited to 'frontends')
-rw-r--r--frontends/monkey/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/frontends/monkey/main.c b/frontends/monkey/main.c
index a89314440..1aced80cf 100644
--- a/frontends/monkey/main.c
+++ b/frontends/monkey/main.c
@@ -316,7 +316,7 @@ static void monkey_run(void)
}
}
-#ifndef NDEBUG
+#if (!defined(NDEBUG) && defined(HAVE_EXECINFO))
#include <execinfo.h>
static void *backtrace_buffer[4096];
@@ -325,7 +325,9 @@ __assert_fail(const char *__assertion, const char *__file,
unsigned int __line, const char *__function)
{
int frames;
- fprintf(stderr, "MONKEY: Assertion failure!\n%s:%d: %s: Assertion `%s` failed.\n",
+ fprintf(stderr,
+ "MONKEY: Assertion failure!\n"
+ "%s:%d: %s: Assertion `%s` failed.\n",
__file, __line, __function, __assertion);
frames = backtrace(&backtrace_buffer[0], 4096);