Applied Matt Sealey's patch to remove/isolate all stdio.h function calls.
Instead of mstdio.[ch], use imports.[ch] to isolate these functions.
diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c
index b655766..4023060 100644
--- a/src/mesa/math/m_debug_clip.c
+++ b/src/mesa/math/m_debug_clip.c
@@ -1,4 +1,4 @@
-/* $Id: m_debug_clip.c,v 1.1 2001/05/21 16:33:41 gareth Exp $ */
+/* $Id: m_debug_clip.c,v 1.2 2002/06/29 19:48:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -48,10 +48,12 @@
    "_mesa_clip_tab",
    "_mesa_clip_np_tab"
 };
+#ifdef RUN_DEBUG_BENCHMARK
 static char *cstrings[2] = {
    "clip, perspective divide",
    "clip, no divide"
 };
+#endif
 
 
 /* =============================================================
@@ -253,20 +255,20 @@
    }
 
    if ( dco != rco ) {
-      printf( "\n-----------------------------\n" );
-      printf( "dco = 0x%02x   rco = 0x%02x\n", dco, rco );
+      _mesa_printf(NULL, "\n-----------------------------\n" );
+      _mesa_printf(NULL, "dco = 0x%02x   rco = 0x%02x\n", dco, rco );
       return 0;
    }
    if ( dca != rca ) {
-      printf( "\n-----------------------------\n" );
-      printf( "dca = 0x%02x   rca = 0x%02x\n", dca, rca );
+      _mesa_printf(NULL, "\n-----------------------------\n" );
+      _mesa_printf(NULL, "dca = 0x%02x   rca = 0x%02x\n", dca, rca );
       return 0;
    }
    for ( i = 0 ; i < TEST_COUNT ; i++ ) {
       if ( dm[i] != rm[i] ) {
-	 printf( "\n-----------------------------\n" );
-	 printf( "(i = %i)\n", i );
-	 printf( "dm = 0x%02x   rm = 0x%02x\n", dm[i], rm[i] );
+	 _mesa_printf(NULL, "\n-----------------------------\n" );
+	 _mesa_printf(NULL, "(i = %i)\n", i );
+	 _mesa_printf(NULL, "dm = 0x%02x   rm = 0x%02x\n", dm[i], rm[i] );
 	 return 0;
       }
    }
@@ -280,19 +282,19 @@
    for ( i = 0 ; i < TEST_COUNT ; i++ ) {
       for ( j = 0 ; j < 4 ; j++ ) {
          if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) {
-            printf( "\n-----------------------------\n" );
-            printf( "(i = %i, j = %i)  dm = 0x%02x   rm = 0x%02x\n",
+            _mesa_printf(NULL, "\n-----------------------------\n" );
+            _mesa_printf(NULL, "(i = %i, j = %i)  dm = 0x%02x   rm = 0x%02x\n",
 		    i, j, dm[i], rm[i] );
-            printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+            _mesa_printf(NULL, "%f \t %f \t [diff = %e - %i bit missed]\n",
 		    d[i][0], r[i][0], r[i][0]-d[i][0],
 		    MAX_PRECISION - significand_match( d[i][0], r[i][0] ) );
-            printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+            _mesa_printf(NULL, "%f \t %f \t [diff = %e - %i bit missed]\n",
 		    d[i][1], r[i][1], r[i][1]-d[i][1],
 		    MAX_PRECISION - significand_match( d[i][1], r[i][1] ) );
-            printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+            _mesa_printf(NULL, "%f \t %f \t [diff = %e - %i bit missed]\n",
 		    d[i][2], r[i][2], r[i][2]-d[i][2],
 		    MAX_PRECISION - significand_match( d[i][2], r[i][2] ) );
-            printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+            _mesa_printf(NULL, "%f \t %f \t [diff = %e - %i bit missed]\n",
 		    d[i][3], r[i][3], r[i][3]-d[i][3],
 		    MAX_PRECISION - significand_match( d[i][3], r[i][3] ) );
             return 0;
@@ -318,19 +320,19 @@
    if ( mesa_profile ) {
       if ( !counter_overhead ) {
 	 INIT_COUNTER();
-	 printf( "counter overhead: %ld cycles\n\n", counter_overhead );
+	 _mesa_printf(NULL, "counter overhead: %ld cycles\n\n", counter_overhead );
       }
-      printf( "cliptest results after hooking in %s functions:\n", description );
+      _mesa_printf(NULL, "cliptest results after hooking in %s functions:\n", description );
    }
 #endif
 
 #ifdef RUN_DEBUG_BENCHMARK
    if ( mesa_profile ) {
-      printf( "\n\t" );
+      _mesa_printf(NULL, "\n\t" );
       for ( psize = 2 ; psize <= 4 ; psize++ ) {
-	 printf( " p%d\t", psize );
+	 _mesa_printf(NULL, " p%d\t", psize );
       }
-      printf( "\n--------------------------------------------------------\n\t" );
+      _mesa_printf(NULL, "\n--------------------------------------------------------\n\t" );
    }
 #endif
 
@@ -341,23 +343,23 @@
 
 	 if ( test_cliptest_function( func, np, psize, cycles ) == 0 ) {
 	    char buf[100];
-	    sprintf( buf, "%s[%d] failed test (%s)",
+	    _mesa_sprintf(NULL, buf, "%s[%d] failed test (%s)",
 		     cnames[np], psize, description );
 	    _mesa_problem( NULL, buf );
 	 }
 #ifdef RUN_DEBUG_BENCHMARK
 	 if ( mesa_profile )
-	    printf( " %li\t", benchmark_tab[np][psize-1] );
+	    _mesa_printf(NULL, " %li\t", benchmark_tab[np][psize-1] );
 #endif
       }
 #ifdef RUN_DEBUG_BENCHMARK
       if ( mesa_profile )
-	 printf( " | [%s]\n\t", cstrings[np] );
+	 _mesa_printf(NULL, " | [%s]\n\t", cstrings[np] );
 #endif
    }
 #ifdef RUN_DEBUG_BENCHMARK
    if ( mesa_profile )
-      printf( "\n" );
+      _mesa_printf(NULL, "\n" );
 #endif
 }
 
diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c
index 392e7c6..ec56244 100644
--- a/src/mesa/math/m_debug_norm.c
+++ b/src/mesa/math/m_debug_norm.c
@@ -1,4 +1,4 @@
-/* $Id: m_debug_norm.c,v 1.8 2002/01/05 20:51:12 brianp Exp $ */
+/* $Id: m_debug_norm.c,v 1.9 2002/06/29 19:48:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -181,6 +181,15 @@
  * Normal transformation tests
  */
 
+static void init_matrix( GLfloat *m )
+{
+   m[0] = 63.0; m[4] = 43.0; m[ 8] = 29.0; m[12] = 43.0;
+   m[1] = 55.0; m[5] = 17.0; m[ 9] = 31.0; m[13] =  7.0;
+   m[2] = 44.0; m[6] =  9.0; m[10] =  7.0; m[14] =  3.0;
+   m[3] = 11.0; m[7] = 23.0; m[11] = 91.0; m[15] =  9.0;
+}
+
+
 static int test_norm_function( normal_func func, int mtype, long *cycles )
 {
    GLvector4f source[1], dest[1], dest2[1], ref[1], ref2[1];
@@ -282,15 +291,15 @@
    for ( i = 0 ; i < TEST_COUNT ; i++ ) {
       for ( j = 0 ; j < 3 ; j++ ) {
          if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) {
-            printf( "-----------------------------\n" );
-            printf( "(i = %i, j = %i)\n", i, j );
-            printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+            _mesa_printf(NULL, "-----------------------------\n" );
+            _mesa_printf(NULL, "(i = %i, j = %i)\n", i, j );
+            _mesa_printf(NULL, "%f \t %f \t [ratio = %e - %i bit missed]\n",
 		    d[i][0], r[i][0], r[i][0]/d[i][0],
 		    MAX_PRECISION - significand_match( d[i][0], r[i][0] ) );
-            printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+            _mesa_printf(NULL, "%f \t %f \t [ratio = %e - %i bit missed]\n",
 		    d[i][1], r[i][1], r[i][1]/d[i][1],
 		    MAX_PRECISION - significand_match( d[i][1], r[i][1] ) );
-            printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+            _mesa_printf(NULL, "%f \t %f \t [ratio = %e - %i bit missed]\n",
 		    d[i][2], r[i][2], r[i][2]/d[i][2],
 		    MAX_PRECISION - significand_match( d[i][2], r[i][2] ) );
             return 0;
@@ -298,15 +307,15 @@
 
          if ( norm_normalize_types[mtype] != 0 ) {
             if ( significand_match( d2[i][j], r2[i][j] ) < REQUIRED_PRECISION ) {
-               printf( "------------------- precalculated length case ------\n" );
-               printf( "(i = %i, j = %i)\n", i, j );
-               printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+               _mesa_printf(NULL, "------------------- precalculated length case ------\n" );
+               _mesa_printf(NULL, "(i = %i, j = %i)\n", i, j );
+               _mesa_printf(NULL, "%f \t %f \t [ratio = %e - %i bit missed]\n",
 		       d2[i][0], r2[i][0], r2[i][0]/d2[i][0],
 		       MAX_PRECISION - significand_match( d2[i][0], r2[i][0] ) );
-               printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+               _mesa_printf(NULL, "%f \t %f \t [ratio = %e - %i bit missed]\n",
 		       d2[i][1], r2[i][1], r2[i][1]/d2[i][1],
 		       MAX_PRECISION - significand_match( d2[i][1], r2[i][1] ) );
-               printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+               _mesa_printf(NULL, "%f \t %f \t [ratio = %e - %i bit missed]\n",
 		       d2[i][2], r2[i][2], r2[i][2]/d2[i][2],
 		       MAX_PRECISION - significand_match( d2[i][2], r2[i][2] ) );
                return 0;
@@ -334,11 +343,11 @@
    if ( mesa_profile ) {
       if ( !counter_overhead ) {
 	 INIT_COUNTER();
-	 printf( "counter overhead: %ld cycles\n\n", counter_overhead );
+	 _mesa_printf(NULL, "counter overhead: %ld cycles\n\n", counter_overhead );
       }
-      printf( "normal transform results after hooking in %s functions:\n",
+      _mesa_printf(NULL, "normal transform results after hooking in %s functions:\n",
 	      description );
-      printf( "\n-------------------------------------------------------\n" );
+      _mesa_printf(NULL, "\n-------------------------------------------------------\n" );
    }
 #endif
 
@@ -348,21 +357,21 @@
 
       if ( test_norm_function( func, mtype, cycles ) == 0 ) {
 	 char buf[100];
-	 sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)",
+	 _mesa_sprintf(NULL, buf, "_mesa_normal_tab[0][%s] failed test (%s)",
 		  norm_strings[mtype], description );
 	 _mesa_problem( NULL, buf );
       }
 
 #ifdef RUN_DEBUG_BENCHMARK
       if ( mesa_profile ) {
-	 printf( " %li\t", benchmark_tab[mtype] );
-	 printf( " | [%s]\n", norm_strings[mtype] );
+	 _mesa_printf(NULL, " %li\t", benchmark_tab[mtype] );
+	 _mesa_printf(NULL, " | [%s]\n", norm_strings[mtype] );
       }
 #endif
    }
 #ifdef RUN_DEBUG_BENCHMARK
    if ( mesa_profile ) {
-      printf( "\n" );
+      _mesa_printf(NULL, "\n" );
       fflush( stdout );
    }
 #endif
diff --git a/src/mesa/math/m_debug_util.h b/src/mesa/math/m_debug_util.h
index efedda9..f96a6b8 100644
--- a/src/mesa/math/m_debug_util.h
+++ b/src/mesa/math/m_debug_util.h
@@ -1,4 +1,4 @@
-/* $Id: m_debug_util.h,v 1.4 2001/05/23 14:27:03 brianp Exp $ */
+/* $Id: m_debug_util.h,v 1.5 2002/06/29 19:48:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -263,15 +263,6 @@
 
 enum { NIL = 0, ONE = 1, NEG = -1, VAR = 2 };
 
-static void init_matrix( GLfloat *m )
-{
-   m[0] = 63.0; m[4] = 43.0; m[ 8] = 29.0; m[12] = 43.0;
-   m[1] = 55.0; m[5] = 17.0; m[ 9] = 31.0; m[13] =  7.0;
-   m[2] = 44.0; m[6] =  9.0; m[10] =  7.0; m[14] =  3.0;
-   m[3] = 11.0; m[7] = 23.0; m[11] = 91.0; m[15] =  9.0;
-}
-
-
 /* Ensure our arrays are correctly aligned.
  */
 #if defined(__GNUC__)
diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c
index 9cbb95c..fb79a31 100644
--- a/src/mesa/math/m_debug_xform.c
+++ b/src/mesa/math/m_debug_xform.c
@@ -1,4 +1,4 @@
-/* $Id: m_debug_xform.c,v 1.8 2001/03/30 14:44:43 gareth Exp $ */
+/* $Id: m_debug_xform.c,v 1.9 2002/06/29 19:48:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -150,6 +150,14 @@
  * Vertex transformation tests
  */
 
+static void init_matrix( GLfloat *m )
+{
+   m[0] = 63.0; m[4] = 43.0; m[ 8] = 29.0; m[12] = 43.0;
+   m[1] = 55.0; m[5] = 17.0; m[ 9] = 31.0; m[13] =  7.0;
+   m[2] = 44.0; m[6] =  9.0; m[10] =  7.0; m[14] =  3.0;
+   m[3] = 11.0; m[7] = 23.0; m[11] = 91.0; m[15] =  9.0;
+}
+
 static GLfloat s[TEST_COUNT][4] ALIGN16;
 static GLfloat d[TEST_COUNT][4] ALIGN16;
 static GLfloat r[TEST_COUNT][4] ALIGN16;
@@ -242,18 +250,18 @@
    for ( i = 0 ; i < TEST_COUNT ; i++ ) {
       for ( j = 0 ; j < 4 ; j++ ) {
          if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) {
-            printf( "-----------------------------\n" );
-            printf( "(i = %i, j = %i)\n", i, j );
-            printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+            _mesa_printf(NULL, "-----------------------------\n" );
+            _mesa_printf(NULL, "(i = %i, j = %i)\n", i, j );
+            _mesa_printf(NULL, "%f \t %f \t [diff = %e - %i bit missed]\n",
 		    d[i][0], r[i][0], r[i][0]-d[i][0],
 		    MAX_PRECISION - significand_match( d[i][0], r[i][0] ) );
-            printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+            _mesa_printf(NULL, "%f \t %f \t [diff = %e - %i bit missed]\n",
 		    d[i][1], r[i][1], r[i][1]-d[i][1],
 		    MAX_PRECISION - significand_match( d[i][1], r[i][1] ) );
-            printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+            _mesa_printf(NULL, "%f \t %f \t [diff = %e - %i bit missed]\n",
 		    d[i][2], r[i][2], r[i][2]-d[i][2],
 		    MAX_PRECISION - significand_match( d[i][2], r[i][2] ) );
-            printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+            _mesa_printf(NULL, "%f \t %f \t [diff = %e - %i bit missed]\n",
 		    d[i][3], r[i][3], r[i][3]-d[i][3],
 		    MAX_PRECISION - significand_match( d[i][3], r[i][3] ) );
             return 0;
@@ -280,19 +288,19 @@
    if ( mesa_profile ) {
       if ( !counter_overhead ) {
 	 INIT_COUNTER();
-	 printf( "counter overhead: %ld cycles\n\n", counter_overhead );
+	 _mesa_printf(NULL, "counter overhead: %ld cycles\n\n", counter_overhead );
       }
-      printf( "transform results after hooking in %s functions:\n", description );
+      _mesa_printf(NULL, "transform results after hooking in %s functions:\n", description );
    }
 #endif
 
 #ifdef RUN_DEBUG_BENCHMARK
    if ( mesa_profile ) {
-      printf( "\n" );
+      _mesa_printf(NULL, "\n" );
       for ( psize = 1 ; psize <= 4 ; psize++ ) {
-	 printf( " p%d\t", psize );
+	 _mesa_printf(NULL, " p%d\t", psize );
       }
-      printf( "\n--------------------------------------------------------\n" );
+      _mesa_printf(NULL, "\n--------------------------------------------------------\n" );
    }
 #endif
 
@@ -303,23 +311,23 @@
 
 	 if ( test_transform_function( func, psize, mtype, cycles ) == 0 ) {
 	    char buf[100];
-	    sprintf( buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)",
+	    _mesa_sprintf(NULL, buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)",
 		     psize, mstrings[mtype], description );
 	    _mesa_problem( NULL, buf );
 	 }
 #ifdef RUN_DEBUG_BENCHMARK
 	 if ( mesa_profile )
-	    printf( " %li\t", benchmark_tab[psize-1][mtype] );
+	    _mesa_printf(NULL, " %li\t", benchmark_tab[psize-1][mtype] );
 #endif
       }
 #ifdef RUN_DEBUG_BENCHMARK
       if ( mesa_profile )
-	 printf( " | [%s]\n", mstrings[mtype] );
+	 _mesa_printf(NULL, " | [%s]\n", mstrings[mtype] );
 #endif
    }
 #ifdef RUN_DEBUG_BENCHMARK
    if ( mesa_profile )
-      printf( "\n" );
+      _mesa_printf(NULL, "\n" );
 #endif
 }
 
diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
index 8ce62d6..2a69336 100644
--- a/src/mesa/math/m_matrix.c
+++ b/src/mesa/math/m_matrix.c
@@ -1,4 +1,4 @@
-/* $Id: m_matrix.c,v 1.11 2002/03/29 17:18:08 brianp Exp $ */
+/* $Id: m_matrix.c,v 1.12 2002/06/29 19:48:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -37,6 +37,7 @@
 #include <math.h>
 
 #include "glheader.h"
+#include "imports.h"
 #include "macros.h"
 #include "mem.h"
 #include "mmath.h"
@@ -136,25 +137,25 @@
 {
    int i;
    for (i=0;i<4;i++) {
-      fprintf(stderr,"\t%f %f %f %f\n", m[i], m[4+i], m[8+i], m[12+i] );
+      _mesa_debug(NULL,"\t%f %f %f %f\n", m[i], m[4+i], m[8+i], m[12+i] );
    }
 }
 
 void
 _math_matrix_print( const GLmatrix *m )
 {
-   fprintf(stderr, "Matrix type: %s, flags: %x\n", types[m->type], m->flags);
+   _mesa_debug(NULL, "Matrix type: %s, flags: %x\n", types[m->type], m->flags);
    print_matrix_floats(m->m);
-   fprintf(stderr, "Inverse: \n");
+   _mesa_debug(NULL, "Inverse: \n");
    if (m->inv) {
       GLfloat prod[16];
       print_matrix_floats(m->inv);
       matmul4(prod, m->m, m->inv);
-      fprintf(stderr, "Mat * Inverse:\n");
+      _mesa_debug(NULL, "Mat * Inverse:\n");
       print_matrix_floats(prod);
    }
    else {
-      fprintf(stderr, "  - not available\n");
+      _mesa_debug(NULL, "  - not available\n");
    }
 }
 
@@ -468,6 +469,8 @@
 }
 
 
+#if 0
+/* broken */
 static GLboolean invert_matrix_perspective( GLmatrix *mat )
 {
    const GLfloat *in = mat->m;
@@ -492,6 +495,7 @@
 
    return GL_TRUE;
 }
+#endif
 
 
 typedef GLboolean (*inv_mat_func)( GLmatrix *mat );
diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c
index 0195faf..b94afdd 100644
--- a/src/mesa/math/m_vector.c
+++ b/src/mesa/math/m_vector.c
@@ -1,4 +1,4 @@
-/* $Id: m_vector.c,v 1.6 2001/03/12 00:48:41 gareth Exp $ */
+/* $Id: m_vector.c,v 1.7 2002/06/29 19:48:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -30,6 +30,7 @@
 
 
 #include "glheader.h"
+#include "imports.h"
 #include "macros.h"
 #include "mem.h"
 
@@ -367,36 +368,36 @@
    GLfloat *d = (GLfloat *)v->data;
    GLuint j, i = 0, count;
 
-   printf("data-start\n");
+   _mesa_printf(NULL, "data-start\n");
    for ( ; d != v->start ; STRIDE_F(d, v->stride), i++)
-      printf( t, i, d[0], d[1], d[2], d[3]);
+      _mesa_printf(NULL, t, i, d[0], d[1], d[2], d[3]);
 
-   printf("start-count(%u)\n", v->count);
+   _mesa_printf(NULL, "start-count(%u)\n", v->count);
    count = i + v->count;
 
    if (culling) {
       for ( ; i < count ; STRIDE_F(d, v->stride), i++)
 	 if (cullmask[i])
-	    printf( t, i, d[0], d[1], d[2], d[3]);
+	    _mesa_printf(NULL, t, i, d[0], d[1], d[2], d[3]);
    }
    else {
       for ( ; i < count ; STRIDE_F(d, v->stride), i++)
-	 printf( t, i, d[0], d[1], d[2], d[3]);
+	 _mesa_printf(NULL, t, i, d[0], d[1], d[2], d[3]);
    }
 
    for (j = v->size ; j < 4; j++) {
       if ((v->flags & (1<<j)) == 0) {
 
-	 printf("checking col %u is clean as advertised ", j);
+	 _mesa_printf(NULL, "checking col %u is clean as advertised ", j);
 
 	 for (i = 0, d = (GLfloat *) v->data ;
 	      i < count && d[j] == c[j] ;
 	      i++, STRIDE_F(d, v->stride)) {};
 
 	 if (i == count)
-	    printf(" --> ok\n");
+	    _mesa_printf(NULL, " --> ok\n");
 	 else
-	    printf(" --> Failed at %u ******\n", i);
+	    _mesa_printf(NULL, " --> Failed at %u ******\n", i);
       }
    }
 }
@@ -410,20 +411,20 @@
    GLfloat *d = (GLfloat *)v->data;
    GLuint i = 0, count;
 
-   printf("data-start\n");
+   _mesa_printf(NULL, "data-start\n");
    for ( ; d != v->start ; STRIDE_F(d,v->stride), i++)
-      printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
+      _mesa_printf(NULL,  "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
 
-   printf("start-count(%u)\n", v->count);
+   _mesa_printf(NULL, "start-count(%u)\n", v->count);
    count = i + v->count;
 
    if (culling) {
       for ( ; i < count ; STRIDE_F(d,v->stride), i++)
 	 if (cullmask[i])
-	    printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
+	    _mesa_printf(NULL, "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
    }
    else {
       for ( ; i < count ; STRIDE_F(d,v->stride), i++)
-	 printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
+	 _mesa_printf(NULL, "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]);
    }
 }