From 8d0f9c8819f0b6fa8b2801909ba343f5407d8b67 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 29 Aug 2005 20:40:07 +0000 Subject: Check for execinfo.h and use it only if it exists. 2005-08-29 Christian Persch * configure.ac: * lib/ev-debug.c: (trap_handler): Check for execinfo.h and use it only if it exists. --- (limited to 'lib/ev-debug.c') diff --git a/lib/ev-debug.c b/lib/ev-debug.c index 8648e2d..0173a7d 100644 --- a/lib/ev-debug.c +++ b/lib/ev-debug.c @@ -29,7 +29,9 @@ #include #include #include +#ifdef HAVE_EXECINFO_H #include +#endif static GHashTable *ev_profilers_hash = NULL; static const char *ev_profile_modules = NULL; @@ -98,11 +100,15 @@ trap_handler (const char *log_domain, { if (strcmp (ev_debug_break, "stack") == 0) { +#ifdef HAVE_EXECINFO_H void *array[MAX_DEPTH]; size_t size; size = backtrace (array, MAX_DEPTH); backtrace_symbols_fd (array, size, 2); +#else + g_on_error_stack_trace (g_get_prgname ()); +#endif } else if (strcmp (ev_debug_break, "trap") == 0) { -- cgit v0.9.1