All pastes #409480 Raw Edit

Untitled

public text v1 · immutable
#409480 ·published 2007-03-25 19:02 UTC
rendered paste body
Index: src/ports/linux/sys_linux.c
===================================================================
--- src/ports/linux/sys_linux.c (Revision 7028)
+++ src/ports/linux/sys_linux.c (Arbeitskopie)
@@ -202,7 +202,7 @@
  * @brief Obtain a backtrace and print it to stderr.
  * @note Adapted from http://www.delorie.com/gnu/docs/glibc/libc_665.html
  */
-#ifdef __x86_64__
+#if defined(__x86_64__) || defined(__powerpc__)
 void Sys_Backtrace (int sig)
 #else
 void Sys_Backtrace (int sig, siginfo_t *siginfo, void *secret)
@@ -214,8 +214,10 @@
        size_t          i;
        char            **strings;
 #ifndef __x86_64__
+#ifndef __powerpc__
        ucontext_t      *uc = (ucontext_t *)secret;
 #endif
+#endif
 
        signal (SIGSEGV, SIG_DFL);
 
@@ -235,8 +237,10 @@
        size = backtrace (array, sizeof(array)/sizeof(void*));
 
 #ifndef __x86_64__
+#ifndef __powerpc__
        array[1] = (void *) uc->uc_mcontext.gregs[REG_EIP];
 #endif
+#endif
 
        strings = backtrace_symbols (array, size);