diff options
author | Juergen Keil <jkeil@users.sourceforge.net> | 2003-02-28 21:57:17 +0000 |
---|---|---|
committer | Juergen Keil <jkeil@users.sourceforge.net> | 2003-02-28 21:57:17 +0000 |
commit | 5221452a38f5814ce0986ac2380a4783552a7fd3 (patch) | |
tree | d4019029fd70c1b4323d36ba61cfc1e742238454 | |
parent | 92e8ede8bfa73289d19383389356e0d8c046f34f (diff) | |
download | xine-lib-5221452a38f5814ce0986ac2380a4783552a7fd3.tar.gz xine-lib-5221452a38f5814ce0986ac2380a4783552a7fd3.tar.bz2 |
Add some autoconf checks for execinfo.h and the backtrace() function
CVS patchset: 4308
CVS date: 2003/02/28 21:57:17
-rw-r--r-- | src/xine-utils/xineutils.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index d1e2d1981..812cd087c 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xineutils.h,v 1.34 2003/02/28 02:51:52 storri Exp $ + * $Id: xineutils.h,v 1.35 2003/02/28 21:57:17 jkeil Exp $ * */ #ifndef XINEUTILS_H @@ -42,7 +42,9 @@ extern "C" { #include <stdio.h> #include <string.h> +#if HAVE_EXECINFO_H #include <execinfo.h> +#endif #ifdef __SUNPRO_C #define inline @@ -796,6 +798,7 @@ extern int v_b_table[256]; static void print_trace (void) { +#if HAVE_BACKTRACE void *array[10]; size_t size; char **strings; @@ -810,6 +813,11 @@ print_trace (void) printf ("%s\n", strings[i]); } free (strings); +#elif HAVE_PRINTSTACK + printstack(STDOUT_FILENO); +#else + printf("stack backtrace not available.\n"); +#endif } /** @@ -819,7 +827,7 @@ print_trace (void) #define XINE_ASSERT(exp, desc, args...) \ if (!(exp)) { \ printf("%s:%s:%d: assertion `" #exp "' failed. " desc "\n\n", \ - __FILE__, __FUNCTION__, __LINE__, ##args); \ + __FILE__, __XINE_FUNCTION__, __LINE__, ##args); \ print_trace(); \ abort(); \ } |