This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  6e4c9000aa52c0b8140e612cb27fb4e4fc6ac82c (commit)
       via  ef29f5ef895f64ad7312ffe48029eee925ac3ae0 (commit)
       via  7de8f67af3fce3df9aee2b2a1c703fcbf4df6625 (commit)
      from  e81aa1a379fa721c800caef75c74e26e8acb9585 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e4c9000aa52c0b8140e612cb27fb4e4fc6ac82c
commit 6e4c9000aa52c0b8140e612cb27fb4e4fc6ac82c
Merge: e81aa1a ef29f5e
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Sep 14 09:24:28 2015 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Mon Sep 14 09:24:28 2015 -0400

    Merge topic 'update-kwsys' into next
    
    ef29f5ef Merge branch 'upstream-kwsys' into update-kwsys
    7de8f67a KWSys 2015-09-11 (cfeb27cc)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ef29f5ef895f64ad7312ffe48029eee925ac3ae0
commit ef29f5ef895f64ad7312ffe48029eee925ac3ae0
Merge: 6dad4c2 7de8f67
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Sep 14 09:24:05 2015 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Mon Sep 14 09:24:05 2015 -0400

    Merge branch 'upstream-kwsys' into update-kwsys


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7de8f67af3fce3df9aee2b2a1c703fcbf4df6625
commit 7de8f67af3fce3df9aee2b2a1c703fcbf4df6625
Author:     KWSys Robot <kwro...@kitware.com>
AuthorDate: Fri Sep 11 11:20:29 2015 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Mon Sep 14 09:24:02 2015 -0400

    KWSys 2015-09-11 (cfeb27cc)
    
    Extract upstream KWSys using the following shell commands.
    
    $ git archive --prefix=upstream-kwsys/ cfeb27cc | tar x
    $ git shortlog --no-merges --abbrev=8 --format='%h %s' dc3fdd7f..cfeb27cc
    Gilles Khouzam (2):
          27714139 SystemTools: Call GetVersionEx more robustly
          cfeb27cc SystemTools: Report Windows 7, 8, 8.1 and 10 by name

diff --git a/SystemTools.cxx b/SystemTools.cxx
index 97a1df8..3857e41 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -4879,11 +4879,8 @@ std::string 
SystemTools::GetOperatingSystemNameAndVersion()
   OSVERSIONINFOEXA osvi;
   BOOL bOsVersionInfoEx;
 
-  // Try calling GetVersionEx using the OSVERSIONINFOEX structure.
-  // If that fails, try using the OSVERSIONINFO structure.
-
-  ZeroMemory(&osvi, sizeof(OSVERSIONINFOEXA));
-  osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
+  ZeroMemory(&osvi, sizeof(osvi));
+  osvi.dwOSVersionInfoSize = sizeof(osvi);
 
 #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
 # pragma warning (push)
@@ -4893,14 +4890,10 @@ std::string 
SystemTools::GetOperatingSystemNameAndVersion()
 #  pragma warning (disable:4996)
 # endif
 #endif
-  bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osvi);
+  bOsVersionInfoEx = GetVersionExA((OSVERSIONINFOA *)&osvi);
   if (!bOsVersionInfoEx)
     {
-    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-    if (!GetVersionEx((OSVERSIONINFO *)&osvi))
-      {
-      return 0;
-      }
+    return 0;
     }
 #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
 # pragma warning (pop)
@@ -4913,10 +4906,56 @@ std::string 
SystemTools::GetOperatingSystemNameAndVersion()
     case VER_PLATFORM_WIN32_NT:
 
       // Test for the specific product family.
+      if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0)
+        {
+        if (osvi.wProductType == VER_NT_WORKSTATION)
+          {
+          res += "Microsoft Windows 10";
+          }
+        else
+          {
+          res += "Microsoft Windows Server 2016 family";
+          }
+        }
+
+      if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3)
+        {
+        if (osvi.wProductType == VER_NT_WORKSTATION)
+          {
+          res += "Microsoft Windows 8.1";
+          }
+        else
+          {
+          res += "Microsoft Windows Server 2012 R2 family";
+          }
+        }
+
+      if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2)
+        {
+        if (osvi.wProductType == VER_NT_WORKSTATION)
+          {
+          res += "Microsoft Windows 8";
+          }
+        else
+          {
+          res += "Microsoft Windows Server 2012 family";
+          }
+        }
+
+      if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1)
+        {
+        if (osvi.wProductType == VER_NT_WORKSTATION)
+          {
+          res += "Microsoft Windows 7";
+          }
+        else
+          {
+          res += "Microsoft Windows Server 2008 R2 family";
+          }
+        }
 
       if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)
         {
-#if (_MSC_VER >= 1300)
         if (osvi.wProductType == VER_NT_WORKSTATION)
           {
           res += "Microsoft Windows Vista";
@@ -4925,9 +4964,6 @@ std::string 
SystemTools::GetOperatingSystemNameAndVersion()
           {
           res += "Microsoft Windows Server 2008 family";
           }
-#else
-        res += "Microsoft Windows Vista or Windows Server 2008";
-#endif
         }
 
       if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2)
@@ -4956,7 +4992,6 @@ std::string 
SystemTools::GetOperatingSystemNameAndVersion()
         {
         // Test for the workstation type.
 
-#if (_MSC_VER >= 1300)
         if (osvi.wProductType == VER_NT_WORKSTATION)
           {
           if (osvi.dwMajorVersion == 4)
@@ -5028,7 +5063,6 @@ std::string 
SystemTools::GetOperatingSystemNameAndVersion()
               }
             }
           }
-#endif // Visual Studio 7 and up
         }
 
       // Test for specific product on Windows NT 4.0 SP5 and earlier

-----------------------------------------------------------------------

Summary of changes:
 Source/kwsys/SystemTools.cxx |   68 +++++++++++++++++++++++++++++++-----------
 1 file changed, 51 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to