Skip to content

Commit 432fb67

Browse files
authored
Merge pull request #3090 from diffblue/macos_backtrace
added backtrace output on the Mac
2 parents 52b610b + 6218b1b commit 432fb67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/invariant.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Author: Martin Brain, [email protected]
2020
// So we should include something explicitly from the C library
2121
// to check if the C library is glibc.
2222
#include <assert.h>
23-
#ifdef __GLIBC__
23+
#if defined(__GLIBC__) || defined(__APPLE__)
2424

2525
// GCC needs LINKFLAGS="-rdynamic" to give function names in the backtrace
2626
#include <execinfo.h>
@@ -78,7 +78,7 @@ static bool output_demangled_name(
7878
void print_backtrace(
7979
std::ostream &out)
8080
{
81-
#ifdef __GLIBC__
81+
#if defined(__GLIBC__) || defined(__APPLE__)
8282
void * stack[50] = {};
8383

8484
std::size_t entries=backtrace(stack, sizeof(stack) / sizeof(void *));

0 commit comments

Comments
 (0)