fixed BACKTRACE_ENABLE macro test

dev
Yann Collet 2018-10-09 12:57:42 -07:00
parent f17c1df1ac
commit 1e0c5466c5
2 changed files with 3 additions and 4 deletions

View File

@ -136,7 +136,6 @@ endif
# enable backtrace symbol names for Linux & Darwin
BACKTRACE ?= 0
DEBUGFLAGS = -DBACKTRACE_ENABLE=$(BACKTRACE)
ifeq (,$(filter Windows%, $(OS)))
ifeq ($(BACKTRACE), 1)
DEBUGFLAGS += -DBACKTRACE_ENABLE=1

View File

@ -38,7 +38,7 @@
#include <assert.h>
#include <errno.h> /* errno */
#include <signal.h>
#ifdef BACKTRACE_ENABLE
#if defined(BACKTRACE_ENABLE) && (BACKTRACE_ENABLE >= 1)
# include <execinfo.h> /* backtrace, backtrace_symbols */
#endif
@ -168,7 +168,7 @@ static void clearHandler(void)
/*-*********************************************************
* Termination signal trapping (Print debug stack trace)
***********************************************************/
#ifdef BACKTRACE_ENABLE
#if defined(BACKTRACE_ENABLE) && (BACKTRACE_ENABLE>=1)
#define MAX_STACK_FRAMES 50
@ -209,7 +209,7 @@ static void ABRThandler(int sig) {
void FIO_addAbortHandler()
{
#ifdef BACKTRACE_ENABLE
#if defined(BACKTRACE_ENABLE) && (BACKTRACE_ENABLE>=1)
signal(SIGABRT, ABRThandler);
signal(SIGFPE, ABRThandler);
signal(SIGILL, ABRThandler);