mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix os_compare_version a bit
This commit is contained in:
parent
1299ecb7f9
commit
aead2631b6
|
@ -2371,16 +2371,12 @@ int os_compare_version(int major, int minor)
|
||||||
mem_zero(&ver, sizeof(OSVERSIONINFO));
|
mem_zero(&ver, sizeof(OSVERSIONINFO));
|
||||||
ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||||
GetVersionEx(&ver);
|
GetVersionEx(&ver);
|
||||||
if(ver.dwMajorVersion > major && ver.dwMinorVersion > minor)
|
if(ver.dwMajorVersion > major || (ver.dwMajorVersion == major && ver.dwMinorVersion > minor))
|
||||||
return 1;
|
return 1;
|
||||||
else if(ver.dwMajorVersion == major && ver.dwMinorVersion == minor)
|
else if(ver.dwMajorVersion == major && ver.dwMinorVersion == minor)
|
||||||
return 0;
|
return 0;
|
||||||
else if(ver.dwMajorVersion < major && ver.dwMinorVersion < minor)
|
|
||||||
return -1;
|
|
||||||
else
|
else
|
||||||
return -2;
|
return -1;
|
||||||
#else
|
|
||||||
#error not implemented
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ void CAutoUpdate::Init()
|
||||||
m_pClient = Kernel()->RequestInterface<IClient>();
|
m_pClient = Kernel()->RequestInterface<IClient>();
|
||||||
m_pStorage = Kernel()->RequestInterface<IStorage>();
|
m_pStorage = Kernel()->RequestInterface<IStorage>();
|
||||||
m_pFetcher = Kernel()->RequestInterface<IFetcher>();
|
m_pFetcher = Kernel()->RequestInterface<IFetcher>();
|
||||||
m_IsWinXP = (os_compare_version(5, 0) == 1 && os_compare_version(6, 0) == -1);
|
m_IsWinXP = os_compare_version(5, 1) <= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAutoUpdate::ProgressCallback(CFetchTask *pTask, void *pUser)
|
void CAutoUpdate::ProgressCallback(CFetchTask *pTask, void *pUser)
|
||||||
|
|
Loading…
Reference in a new issue