summaryrefslogtreecommitdiffstats
path: root/src/mapi/glapi/glapi_gentable.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-12-08 12:27:38 -0800
committerIan Romanick <[email protected]>2011-12-13 16:07:17 -0800
commit7e9cb2ac6dd9af5ea1597df8a2015b620aad57a1 (patch)
treeffc09dac7853a4508978f350561ef1a3a19a9e97 /src/mapi/glapi/glapi_gentable.c
parent0c6b9303227977723a6d03664f71e5eb56ebf139 (diff)
Regenerate files from previous commits
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src/mapi/glapi/glapi_gentable.c')
-rw-r--r--src/mapi/glapi/glapi_gentable.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/mapi/glapi/glapi_gentable.c b/src/mapi/glapi/glapi_gentable.c
index e6e841d5d7d..5c048017074 100644
--- a/src/mapi/glapi/glapi_gentable.c
+++ b/src/mapi/glapi/glapi_gentable.c
@@ -27,8 +27,20 @@
* SOFTWARE.
*/
+/* GLXEXT is the define used in the xserver when the GLX extension is being
+ * built. Hijack this to determine whether this file is being built for the
+ * server or the client.
+ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
-#if defined(DEBUG) && !defined(_WIN32_WCE)
+#if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \
+ || (!defined(GLXEXT) && defined(DEBUG) && !defined(_WIN32_WCE))
+#define USE_BACKTRACE
+#endif
+
+#ifdef USE_BACKTRACE
#include <execinfo.h>
#endif
@@ -41,11 +53,22 @@
#include "glapi.h"
#include "glapitable.h"
+#ifdef GLXEXT
+#include "os.h"
+#endif
+
static void
__glapi_gentable_NoOp(void) {
-#if defined(DEBUG) && !defined(_WIN32_WCE)
- if (getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) {
- const char *fstr = "Unknown";
+ const char *fstr = "Unknown";
+
+ /* Silence potential GCC warning for some #ifdef paths.
+ */
+ (void) fstr;
+#if defined(USE_BACKTRACE)
+#if !defined(GLXEXT)
+ if (getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG"))
+#endif
+ {
void *frames[2];
if(backtrace(frames, 2) == 2) {
@@ -55,9 +78,14 @@ __glapi_gentable_NoOp(void) {
fstr = info.dli_sname;
}
+#if !defined(GLXEXT)
fprintf(stderr, "Call to unimplemented API: %s\n", fstr);
+#endif
}
#endif
+#if defined(GLXEXT)
+ LogMessage(X_ERROR, "GLX: Call to unimplemented API: %s\n", fstr);
+#endif
}
static void