diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:19:49 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:19:49 +0200 |
commit | c8e0e909b4a8d18319fc65434a10dc446434817c (patch) | |
tree | eee91e7d2ce229dd043811eae8f1e2bd78061916 /zen/win_ver.h | |
parent | 5.2 (diff) | |
download | FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.gz FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.bz2 FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.zip |
5.3
Diffstat (limited to 'zen/win_ver.h')
-rw-r--r-- | zen/win_ver.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/zen/win_ver.h b/zen/win_ver.h index 464b7264..c2162c61 100644 --- a/zen/win_ver.h +++ b/zen/win_ver.h @@ -27,35 +27,29 @@ bool win7OrLater(); +//######################### implementation ######################### +//version overview: http://msdn.microsoft.com/en-us/library/ms724834(VS.85).aspx +//2000 is version 5.0 +//XP is version 5.1 +//Server 2003 is version 5.2 +//Vista is version 6.0 +//Seven is version 6.1 - - - - -//######################### implementation ######################### namespace impl { inline -bool winXyOrLater(DWORD major, DWORD minor) //migrate: hold version data as static variable, as soon as C++11 thread safe statics are available in VS +bool winXyOrLater(DWORD major, DWORD minor) { OSVERSIONINFO osvi = {}; osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (::GetVersionEx(&osvi)) + if (::GetVersionEx(&osvi)) //38 ns per call! (yes, that's nano!) -> we do NOT miss C++11 thread safe statics right now... return osvi.dwMajorVersion > major || (osvi.dwMajorVersion == major && osvi.dwMinorVersion >= minor); return false; } } -//version overview: http://msdn.microsoft.com/en-us/library/ms724834(VS.85).aspx - -//2000 is version 5.0 -//XP is version 5.1 -//Server 2003 is version 5.2 -//Vista is version 6.0 -//Seven is version 6.1 - inline bool winXpOrLater() { return impl::winXyOrLater(5, 1); } |