From 74e1ddcb3363637a219d174195a31c9d975e2940 Mon Sep 17 00:00:00 2001 From: Michael Wild Date: Fri, 15 May 2009 16:41:18 +0200 Subject: [PATCH] FIX: Use system execinfo.h on OS X >= 10.5 And fail for 64-bit architectures when compiling for OS X < 10.5. Signed-off-by: Michael Wild --- src/OSspecific/Unix/printStack.C | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/OSspecific/Unix/printStack.C b/src/OSspecific/Unix/printStack.C index 4523b376a..0d20a72e3 100644 --- a/src/OSspecific/Unix/printStack.C +++ b/src/OSspecific/Unix/printStack.C @@ -32,8 +32,14 @@ License #include #include -#ifndef darwin -#include +#if !defined(darwin) || __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 +# include +#else +# if defined(__x86_64__) || defined(__ppc64__) +# error "Currently compiling FreeFOAM for the x86_64 and ppc64 architectures with Mac OS X target version < 10.5 is not possible!" +# else +# warning "Emulating backtrace and backtrace_symbols with a dirty hack!" +# endif #endif #include @@ -174,7 +180,7 @@ void getSymbolForRaw os << "Uninterpreted: " << raw.c_str(); } -#ifdef darwin +#if defined(darwin) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050 // Trying to emulate the original backtrace and backtrace_symbol from the glibc // After an idea published by Rush Manbert at http://lists.apple.com/archives/xcode-users/2006/Apr/msg00528.html -- 2.11.4.GIT