From 9f2774a500d779af9a38f42bfb03b507444a47b0 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 15 Aug 2008 17:55:32 +0000 Subject: [PATCH] execinfo.h is a GNU extension so check for glibc --- source/debug/backtrace.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/debug/backtrace.cpp b/source/debug/backtrace.cpp index 643fdf2..5e96005 100644 --- a/source/debug/backtrace.cpp +++ b/source/debug/backtrace.cpp @@ -4,7 +4,10 @@ This file is part of libmspcore Copyright © 2007 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ -#ifndef WIN32 + +// Must include something to test for glibc +#include +#if !defined(WIN32) && defined(__GLIBC__) #include #include #endif @@ -18,12 +21,10 @@ namespace Debug { Backtrace Backtrace::create() { -#ifndef WIN32 +#if !defined(WIN32) && defined(__GLIBC__) void *addresses[50]; int count=::backtrace(addresses, 50); - //char **symbols=backtrace_symbols(addresses, count); - Backtrace bt; Dl_info dli; for(int i=0; i