[Mesa-dev] [PATCH] mesa: fix Mingw32 printf() warning about %llx format

Brian Paul brianp at vmware.com
Fri Jun 22 09:30:28 PDT 2012


---
 src/mesa/program/prog_print.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/mesa/program/prog_print.c b/src/mesa/program/prog_print.c
index 46f1df0..be67b93 100644
--- a/src/mesa/program/prog_print.c
+++ b/src/mesa/program/prog_print.c
@@ -970,9 +970,16 @@ _mesa_fprint_program_parameters(FILE *f,
 {
    GLuint i;
 
-   fprintf(f, "InputsRead: 0x%llx (0b%s)\n",
+   /* Need to use __mingw_fprintf() to parse the 0x%llx format with Mingw32 */
+#ifdef __MINGW32__
+#define FPRINTF __mingw_fprintf
+#else
+#define FPRINTF fprintf
+#endif
+
+   FPRINTF(f, "InputsRead: 0x%llx (0b%s)\n",
            (unsigned long long) prog->InputsRead, binary(prog->InputsRead));
-   fprintf(f, "OutputsWritten: 0x%llx (0b%s)\n",
+   FPRINTF(f, "OutputsWritten: 0x%llx (0b%s)\n",
                  (unsigned long long)prog->OutputsWritten, 
 		 binary(prog->OutputsWritten));
    fprintf(f, "NumInstructions=%d\n", prog->NumInstructions);
@@ -1000,6 +1007,8 @@ _mesa_fprint_program_parameters(FILE *f,
    }
 #endif	
    _mesa_print_parameter_list(prog->Parameters);
+
+#undef FPRINTF
 }
 
 
-- 
1.7.3.4



More information about the mesa-dev mailing list