On 27/06/2011 18:38, Jeremy Huddleston wrote:
Those bits in the NoOp stub can be left out on Win32 (or you can tell me the Win32 way of figuring that out). It's just used to provide extra info to give a hint as to which call was unimplemented.
Looking at this a bit more I notice that we already have the autoconf machinery to check if backtrace() is available, so let's use that, rather than trying to come up with a list of targets which have those functions.
There's no easy way to implement equivalent functionality to backtrace() on Win32, which is why cygwin doesn't have a backtrace() function yet :-)
Patch attached, although obviously it's the code generator for this file which should be fixed...
>From a9a5b3b9b01c4258ca1f2d63b6a05efd2238ad5c Mon Sep 17 00:00:00 2001 From: Jon TURNEY <[email protected]> Date: Mon, 27 Jun 2011 15:06:16 +0100 Subject: [PATCH] Guard use of backtrace() with HAVE_BACKTRACE 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 <[email protected]> --- 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
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
