Win: Fix build with Visual Studio 2010

(broken by 607b668ff9)

- Visual Studio 2010 apparently doesn't have the snprintf() inline
  function, so restore the macro that emulates that function using
  _snprintf_s().

- Explicitly include errno.h in strtest.c, since jinclude.h doesn't
  include it when building with Visual Studio.
This commit is contained in:
DRC
2022-03-11 10:50:47 -06:00
parent f3c716a2bc
commit a014845403
9 changed files with 64 additions and 35 deletions

View File

@@ -409,7 +409,7 @@ static void compTest(tjhandle handle, unsigned char **dstBuf,
jpegQual, flags));
}
snprintf(tempStr, 1024, "%s_enc_%s_%s_%s_Q%d.jpg", basename, pfStr, buStr,
SNPRINTF(tempStr, 1024, "%s_enc_%s_%s_%s_Q%d.jpg", basename, pfStr, buStr,
subName[subsamp], jpegQual);
writeJPEG(*dstBuf, *dstSize, tempStr);
printf("Done.\n Result in %s\n", tempStr);
@@ -782,7 +782,7 @@ static int doBmpTest(const char *ext, int width, int align, int height, int pf,
THROW("Could not allocate memory");
initBitmap(buf, width, pitch, height, pf, flags);
snprintf(filename, 80, "test_bmp_%s_%d_%s.%s", pixFormatStr[pf], align,
SNPRINTF(filename, 80, "test_bmp_%s_%d_%s.%s", pixFormatStr[pf], align,
(flags & TJFLAG_BOTTOMUP) ? "bu" : "td", ext);
TRY_TJ(tjSaveImage(filename, buf, width, pitch, height, pf, flags));
md5sum = MD5File(filename, md5buf);