]> git.sesse.net Git - vlc/commitdiff
configure: Check for HAVE_BACKTRACE and HAVE_EXECINFO_H.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 31 May 2008 12:04:33 +0000 (14:04 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 31 May 2008 12:04:33 +0000 (14:04 +0200)
configure.ac
src/misc/objects.c
src/misc/threads.c

index e03cac827fa0d8feaa91a41dfa987a362cd635d8..7cfbe1c440759e4ebedff314bb34be9b59940ac3 100644 (file)
@@ -1137,6 +1137,10 @@ case "${host_cpu}" in
     ;;
 esac
 
+dnl Check for backtrace() support
+AC_CHECK_HEADERS(execinfo.h)
+AC_CHECK_FUNCS(backtrace)
+
 dnl
 dnl  Enable profiling
 dnl
index 4b2e56d3ef8a4b7243bce1f87bf36c95c5cdaadc..d78c6d518b244f239e0afe09871722cdd700a994 100644 (file)
@@ -1482,7 +1482,7 @@ static void ListChildren( vlc_list_t *p_list, vlc_object_t *p_this, int i_type )
 }
 
 #ifndef NDEBUG
-# if defined(__GLIBC__) || defined(__APPLE__)
+# ifdef (HAVE_EXECINFO_H)
 #  include <execinfo.h>
 # endif
 
@@ -1541,7 +1541,7 @@ void vlc_refcheck (vlc_object_t *obj)
              obj->psz_object_type);
     fflush (stderr);
 
-#if defined(__GLIBC__) || defined(__APPLE__)
+#ifdef HAVE_BACKTRACE
     void *stack[20];
     int stackdepth = backtrace (stack, sizeof (stack) / sizeof (stack[0]));
     backtrace_symbols_fd (stack, stackdepth, 2);
index c68dab7c542a64e7c5073862662f9e68b62fc555..57274d6c269b142b1bfd29852fab7c896c730314 100644 (file)
@@ -83,7 +83,7 @@ static inline unsigned long vlc_threadid (void)
      return v.i;
 }
 
-#if defined(__GLIBC__) || defined(__APPLE__)
+#if HAVE_EXECINFO_H
 # include <execinfo.h>
 #endif
 
@@ -125,7 +125,7 @@ void vlc_pthread_fatal (const char *action, int error,
     fflush (stderr);
 #endif
 
-#if defined(__GLIBC__) || defined(__APPLE__)
+#ifdef HAVE_BACKTRACE
     void *stack[20];
     int len = backtrace (stack, sizeof (stack) / sizeof (stack[0]));
     backtrace_symbols_fd (stack, len, 2);