mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Make init_winver() idempotent.
This way, anyone who needs to use the version data can quickly call init_winver to make sure it's been set up, and not waste too much faff redoing the actual work.
This commit is contained in:
parent
5de1df1b94
commit
26dcfcbd44
@ -4,6 +4,11 @@ DWORD osMajorVersion, osMinorVersion, osPlatformId;
|
||||
|
||||
void init_winver(void)
|
||||
{
|
||||
static bool initialised = false;
|
||||
if (initialised)
|
||||
return;
|
||||
initialised = true;
|
||||
|
||||
OSVERSIONINFO osVersion;
|
||||
static HMODULE kernel32_module;
|
||||
DECL_WINDOWS_FUNCTION(static, BOOL, GetVersionExA, (LPOSVERSIONINFO));
|
||||
|
Loading…
Reference in New Issue
Block a user