From 422655d988ffc6a3a00f6dc498ee32a38c010fdb Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Thu, 29 Sep 2016 21:07:57 +0000 Subject: [PATCH] HAVE_UNWIND_BACKTRACE -> HAVE__UNWIND_BACKTRACE Check for existance and not truth value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282767 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/config-ix.cmake | 2 +- include/llvm/Config/config.h.cmake | 2 +- lib/Support/Unix/Signals.inc | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index e3f10361b12..524303d0963 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -149,7 +149,7 @@ endif() # function checks check_symbol_exists(arc4random "stdlib.h" HAVE_DECL_ARC4RANDOM) check_symbol_exists(backtrace "execinfo.h" HAVE_BACKTRACE) -check_symbol_exists(_Unwind_Backtrace "unwind.h" HAVE_UNWIND_BACKTRACE) +check_symbol_exists(_Unwind_Backtrace "unwind.h" HAVE__UNWIND_BACKTRACE) check_symbol_exists(getpagesize unistd.h HAVE_GETPAGESIZE) check_symbol_exists(getrusage sys/resource.h HAVE_GETRUSAGE) check_symbol_exists(setrlimit sys/resource.h HAVE_SETRLIMIT) diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake index 3c9234f941b..f6fd4e5977f 100644 --- a/include/llvm/Config/config.h.cmake +++ b/include/llvm/Config/config.h.cmake @@ -340,7 +340,7 @@ #cmakedefine HAVE_UNISTD_H ${HAVE_UNISTD_H} /* Define to 1 if you have the `_Unwind_Backtrace' function. */ -#cmakedefine HAVE_UNWIND_BACKTRACE ${HAVE_UNWIND_BACKTRACE} +#cmakedefine HAVE__UNWIND_BACKTRACE ${HAVE__UNWIND_BACKTRACE} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UTIME_H ${HAVE_UTIME_H} diff --git a/lib/Support/Unix/Signals.inc b/lib/Support/Unix/Signals.inc index 4661fd68657..3d921fd2e87 100644 --- a/lib/Support/Unix/Signals.inc +++ b/lib/Support/Unix/Signals.inc @@ -43,7 +43,7 @@ #if HAVE_LINK_H #include #endif -#if HAVE_UNWIND_BACKTRACE +#ifdef HAVE__UNWIND_BACKTRACE // FIXME: We should be able to use for any target that has an // _Unwind_Backtrace function, but on FreeBSD the configure test passes // despite the function not existing, and on Android, conflicts @@ -51,7 +51,7 @@ #ifdef __GLIBC__ #include #else -#undef HAVE_UNWIND_BACKTRACE +#undef HAVE__UNWIND_BACKTRACE #endif #endif @@ -355,7 +355,7 @@ static bool findModulesAndOffsets(void **StackTrace, int Depth, } #endif // defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES) && ... -#if defined(ENABLE_BACKTRACES) && defined(HAVE_UNWIND_BACKTRACE) +#if defined(ENABLE_BACKTRACES) && defined(HAVE__UNWIND_BACKTRACE) static int unwindBacktrace(void **StackTrace, int MaxEntries) { if (MaxEntries < 0) return 0; @@ -401,7 +401,7 @@ void llvm::sys::PrintStackTrace(raw_ostream &OS) { if (!depth) depth = backtrace(StackTrace, static_cast(array_lengthof(StackTrace))); #endif -#if defined(HAVE_UNWIND_BACKTRACE) +#if defined(HAVE__UNWIND_BACKTRACE) // Try _Unwind_Backtrace() if backtrace() failed. if (!depth) depth = unwindBacktrace(StackTrace, -- 2.11.0