summaryrefslogtreecommitdiff
path: root/zen/win_ver.h
diff options
context:
space:
mode:
Diffstat (limited to 'zen/win_ver.h')
-rw-r--r--zen/win_ver.h24
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); }
bgstack15