glapi: fix compile with ES
authorGeorge Sapountzis <gsapountzis@gmail.com>
Tue, 2 Mar 2010 01:31:16 +0000 (03:31 +0200)
committerGeorge Sapountzis <gsapountzis@gmail.com>
Tue, 2 Mar 2010 01:32:43 +0000 (03:32 +0200)
src/mesa/glapi/glapi.c
src/mesa/glapi/glapi_getproc.c

index fcb3089..13de594 100644 (file)
@@ -256,7 +256,7 @@ _glapi_set_dispatch(struct _glapi_table *dispatch)
       /* use the no-op functions */
       dispatch = (struct _glapi_table *) __glapi_noop_table;
    }
-#if 0 /* enable this for extra DEBUG */
+#ifdef DEBUG
    else {
       _glapi_check_table_not_null(dispatch);
       _glapi_check_table(dispatch);
@@ -322,10 +322,14 @@ _glapi_get_dispatch_table_size(void)
 void
 _glapi_check_table_not_null(const struct _glapi_table *table)
 {
+#if 0 /* enable this for extra DEBUG */
    const GLuint entries = _glapi_get_dispatch_table_size();
    const void **tab = (const void **) table;
    GLuint i;
    for (i = 1; i < entries; i++) {
       assert(tab[i]);
    }
+#else
+   (void) table;
+#endif
 }
index 5be6d65..a6dbf17 100644 (file)
@@ -773,6 +773,7 @@ _glapi_get_proc_name(GLuint offset)
 void
 _glapi_check_table(const struct _glapi_table *table)
 {
+#if 0 /* enable this for extra DEBUG */
    {
       GLuint BeginOffset = _glapi_get_proc_offset("glBegin");
       char *BeginFunc = (char*) &table->Begin;
@@ -829,4 +830,7 @@ _glapi_check_table(const struct _glapi_table *table)
       assert(setFenceOffset == _gloffset_SetFenceNV);
       assert(setFenceOffset == offset);
    }
+#else
+   (void) table;
+#endif
 }