summaryrefslogtreecommitdiff
path: root/dbus/sigsegv.c
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-05-23 22:28:12 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-12-17 17:25:03 +0100
commite2cba86e65887f09cba7645134f845ce6de81d99 (patch)
tree15bdce5dd32a25983fa8a23e118172ea7a08de49 /dbus/sigsegv.c
parentf2ece2418c875eb7e7ac3d25fbb484ddda47ab46 (diff)
downloadjack2-e2cba86e65887f09cba7645134f845ce6de81d99.tar.gz
wscript: improve check for ucontext
The ucontext functionality is not available on all CPUs with all C libraries. Instead of making just assumptions based on the CPU architecture, this commit adds the necessary checks in wscript to verify the availability of the ucontext functionality, before using it in dbus/sigsegv.c. This avoids the long list of architecture exclusions, and make it more robust when building jack2 for new CPU architectures. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'dbus/sigsegv.c')
-rw-r--r--dbus/sigsegv.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/dbus/sigsegv.c b/dbus/sigsegv.c
index ee12f918..7216fcb7 100644
--- a/dbus/sigsegv.c
+++ b/dbus/sigsegv.c
@@ -104,20 +104,20 @@ static void signal_segv(int signum, siginfo_t* info, void*ptr) {
jack_error("info.si_errno = %d", info->si_errno);
jack_error("info.si_code = %d (%s)", info->si_code, si_code_str);
jack_error("info.si_addr = %p", info->si_addr);
-#if !defined(__alpha__) && !defined(__ia64__) && !defined(__FreeBSD_kernel__) && !defined(__arm__) && !defined(__hppa__) && !defined(__sh__) && !defined(__aarch64__) && !defined(nios2)
+#if defined(HAVE_UCONTEXT) && defined(HAVE_NGREG)
for(i = 0; i < NGREG; i++)
jack_error("reg[%02d] = 0x" REGFORMAT, i,
-#if defined(__powerpc64__)
+#if defined(HAVE_UCONTEXT_GP_REGS)
ucontext->uc_mcontext.gp_regs[i]
-#elif defined(__powerpc__)
+#elif defined(HAVE_UCONTEXT_UC_REGS)
ucontext->uc_mcontext.uc_regs[i]
-#elif defined(__sparc__) && defined(__arch64__)
+#elif defined(HAVE_UCONTEXT_MC_GREGS)
ucontext->uc_mcontext.mc_gregs[i]
-#else
+#elif defined(HAVE_UCONTEXT_GREGS)
ucontext->uc_mcontext.gregs[i]
#endif
);
-#endif /* alpha, ia64, kFreeBSD, arm, hppa */
+#endif /* defined(HAVE_UCONTEXT) && defined(HAVE_NGREG) */
#if defined(SIGSEGV_STACK_X86) || defined(SIGSEGV_STACK_IA64)
# if defined(SIGSEGV_STACK_IA64)