Patch for compiling 7zip/LZMA Souce on Windows
A free file archiver for extremely high compression
Brought to you by:
ipavlov
There is a problem when compiling 7zip source. The problem is due to the GetVersionEx function which is deprecated on Windows 8. The problem can be solved by using the windows helper functions Version helper functions.
//in file CpuArch.c
static Bool CPU_Sys_Is_SSE_Supported()
{
OSVERSIONINFO vi;
vi.dwOSVersionInfoSize = sizeof(vi);
if (!GetVersionEx(&vi))
return False;
return (vi.dwMajorVersion >= 5);
}
//should be replaced by
static Bool CPU_Sys_Is_SSE_Supported()
{
if (!IsWindowsXPOrGreater())
{
return False;
}
return True
}
Similar procedure should also be done for the file NtCheck.h in the Windows directory
I don't like new functions.
Note that someone still want to compile the code for Win95/98/NT/2000.
So we must find another solution for that problem.
This deprecation only means that Windows 8.1 and greater versions will not be identified correctly (as Windows 8).
Some resolutions can be found here:
http://www.codeproject.com/Articles/678606/Part-Overcoming-Windows-s-deprecation-of-GetVe
https://bitbucket.org/AnyCPU/findversion
But as I understand no Windows 8.1+ features are used in 7-Zip and so there is no problem with GetVersionEx exists for it.