[PATCH] Guard use of backtrace() with HAVE_BACKTRACE

Jon TURNEY jon.turney at dronecode.org.uk
Mon Jun 27 07:06:16 PDT 2011


Guard the use of backtrace() with HAVE_BACKTRACE, since we already
have the autoconf machinery for setting that.

For the moment, assume dladdr() is available when backtrace() is

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 glx/glapi_gentable.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/glx/glapi_gentable.c b/glx/glapi_gentable.c
index a9ba3af..b49ae20 100644
--- a/glx/glapi_gentable.c
+++ b/glx/glapi_gentable.c
@@ -31,7 +31,10 @@
 #include <dix-config.h>
 #endif
 
+#ifdef HAVE_BACKTRACE
 #include <execinfo.h>
+#endif
+
 #include <dlfcn.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -46,6 +49,8 @@
 static void
 __glapi_gentable_NoOp(void) {
     const char *fstr = "Unknown";
+
+#ifdef HAVE_BACKTRACE
     void *frames[2];
 
     if(backtrace(frames, 2) == 2) {
@@ -54,6 +59,7 @@ __glapi_gentable_NoOp(void) {
         if(info.dli_sname)
             fstr = info.dli_sname;
     }
+#endif
 
     LogMessage(X_ERROR, "GLX: Call to unimplemented API: %s\n", fstr);
 }
-- 
1.7.5.1


--------------070703060407040701020501--


More information about the xorg-devel mailing list