From f0a2fdd50870d1fc561a0e5a69c8e1cd59d56cf5 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Thu, 13 Mar 2014 11:03:05 +0000 Subject: [PATCH] [trunk] Fix compilation on VS2010 (snprintf is not C89). C++11 should avoid this in the future --- tests/ppm2rgb3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/ppm2rgb3.c b/tests/ppm2rgb3.c index 9d46f98e..c9b4772a 100644 --- a/tests/ppm2rgb3.c +++ b/tests/ppm2rgb3.c @@ -81,6 +81,9 @@ static int writeoutput( const char *fn, FILE *ppm, int X, int Y, int bpp ) /* write single comp as PGM: P5 */ for( i = 0; i < 3; ++i ) { +#ifdef _MSC_VER +#define snprintf _snprintf /* Visual Studio */ +#endif snprintf( outfn, sizeof(outfn), "%s.%s.pgm", fn, exts[i] ); outf[i] = fopen( outfn, "wb" ); if( !outf[i] ) goto cleanup; -- 2.30.2