summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-03-05 16:50:48 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-03-05 16:50:48 -0500
commit48a6b9935d37d28968ef2c31faaae2790385cfde (patch)
treed7a9e2b4793ccc7981f31439c6f6bd9b8341fb9d
parentf2e244503477184717e0d9029c93fd6bcba2fa40 (diff)
fixed compilation if TOC_DEBUG is defined but compiler is not gnu
-rw-r--r--main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main.c b/main.c
index 9f7e554..fb07c1e 100644
--- a/main.c
+++ b/main.c
@@ -34,7 +34,10 @@ consider- should #sizeof always take a Type? it would be more verbose, but we mi
#include "toc.c"
-#if defined TOC_DEBUG && defined __linux__ && defined __GNU_LIBRARY__
+#if defined TOC_DEBUG && defined __GNU_LIBRARY__
+#define BACKTRACE
+#endif
+#ifdef BACKTRACE
#include <signal.h>
#include <execinfo.h>
#include <unistd.h>
@@ -67,7 +70,7 @@ static void signal_handler(int num) {
#endif
int main(int argc, char **argv) {
-#ifdef TOC_DEBUG
+#ifdef BACKTRACE
signal(SIGABRT, signal_handler);
signal(SIGSEGV, signal_handler);
#endif