This is needed to work around a build failure when this test fails, as
it spuriously does when cross-compiling for MinGW using v10 API package,
see https://sourceforge.net/p/mingw-w64/bugs/935/ for more details.
Of course, the fact that the build fails if snprintf() is unavailable is
actually a bug, but in practice this function is available everywhere by
now, so simply stop testing for it.
This mostly cherry picks ceff22ee (Use C99 snprintf, 2021-01-31), but
keeps the test for MSVC versions without vsnprintf() for compatibility.
This reverts commit fb84e7396b which seems
to have added unnecessary stdint.h inclusion breaking compilation with
ancient MSVS version not providing this file.
-----BEGIN PGP SIGNATURE-----
iHUEABEIAB0WIQTr39shsCDuj9FRqI3jAQR94RmJdQUCX95KfAAKCRDjAQR94RmJ
ddHsAP9aNuHBYnueUqBjE34GjNwgwh8rt01MrUT6qYLBomlClgD+L3Xed/AbZH6k
k3RLq2Wyd7YPMyi6/I9FbIw5av98Dis=
=RqwF
-----END PGP SIGNATURE-----
Merge tag 'v4.2.0' into wx
Update to the latest upstream release and rerun autogen.sh.
tif_win32.c: In function '_tiffSizeProc':
tif_win32.c:159:23: warning: passing argument 2 of 'GetFileSizeEx' from incompatible pointer type [-Wincompatible-pointer-types]
159 | if (GetFileSizeEx(fd,&m))
| ^~
| |
| ULARGE_INTEGER *
In file included from c:\msys1021\x86_64-w64-mingw32\include\winbase.h:18,
from c:\msys1021\x86_64-w64-mingw32\include\windows.h:70,
from tif_win32.c:32:
c:\msys1021\x86_64-w64-mingw32\include\fileapi.h:78:73: note: expected 'PLARGE_INTEGER' {aka 'LARGE_INTEGER *'} but argument is of type 'ULARGE_INTEGER *'
78 | WINBASEAPI WINBOOL WINAPI GetFileSizeEx (HANDLE hFile, PLARGE_INTEGER lpFileSize);
| ~~~~~~~~~~~~~~~^~~~~~~~~~
```
So we can have 2 kind of builds with the Zip/Deflate codec:
- zlib only
- zlib + libdeflate
Speed improvements in the 35%-50% range can be expected when libdeflate is used.
Compression level up to 12 is now supported (capped to 9 when zlib is used).
Still requires zlib for situations where libdeflate cannot be used (that
is for scanline access, since libdeflate has no streaming mode)
Pseudo-tag TIFFTAG_DEFLATE_SUBCODEC=DEFLATE_SUBCODEC_ZLIB/DEFLATE_SUBCODEC_LIBDEFLATE
is added to control which subcodec (zlib or libdeflate) should be used (it defaults
of course to libdeflate, when it is available).
This is mostly aimed at being used on the writing side, to be able to reproduce
output of previous libtiff versions at a binary level, in situations where this would
be really needed. Or as a safety belt in case there would be unforeseen issues
with using libdeflate.
It can be used to know when libdeflate is available at runtime (DEFLATE_SUBCODEC_LIBDEFLATE
will be the default value in that situation).
Of course, deflate codestreams produced by libdeflate can be read by zlib, and vice-versa.