Return run-time zlib version from wxGetZlibVersionInfo().

Return the version really used instead of the version the code was compiled
against.

Incidentally, this avoids the use of ZLIB_VERNUM not available in old (1.1)
versions of zlib, thus fixing compilation under Solaris 10.

Closes #14158.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71056 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-03-30 12:16:58 +00:00
parent 33208b4ecb
commit d02a916ba1

View File

@@ -47,10 +47,18 @@ enum {
wxVersionInfo wxGetZlibVersionInfo() wxVersionInfo wxGetZlibVersionInfo()
{ {
return wxVersionInfo("zlib", int major,
ZLIB_VERNUM >> 12, minor,
(ZLIB_VERNUM >> 8) & 0x0F, build;
(ZLIB_VERNUM & 0xFF) / 0x10);
if ( sscanf(zlibVersion(), "%d.%d.%d", &major, &minor, &build) != 3 )
{
major =
minor =
build = 0;
}
return wxVersionInfo("zlib", major, minor, build);
} }
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////