Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2012-10-09 16:47:40 +0400
committerCorinna Vinschen <corinna@vinschen.de>2012-10-09 16:47:40 +0400
commitf085c12fd72e4123f9915a97034d9d88b4874f9f (patch)
tree320501134b7ea283554483156e30433dac40c766 /winsup/utils/cygcheck.cc
parent509212aa98c5e38adb67481a079c9a09d3829f44 (diff)
* cygcheck.cc (dump_sysinfo): Convert "if/else if" chain to a switch
statement. Drop "not yet supported" and "Server" from Windows 2012 output string.
Diffstat (limited to 'winsup/utils/cygcheck.cc')
-rw-r--r--winsup/utils/cygcheck.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc
index f14574f9a..17c15fd38 100644
--- a/winsup/utils/cygcheck.cc
+++ b/winsup/utils/cygcheck.cc
@@ -1433,15 +1433,21 @@ dump_sysinfo ()
BOOL (WINAPI *GetProductInfo) (DWORD, DWORD, DWORD, DWORD, PDWORD) =
(BOOL (WINAPI *)(DWORD, DWORD, DWORD, DWORD, PDWORD))
GetProcAddress (k32, "GetProductInfo");
- if (osversion.dwMinorVersion == 0)
- strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
- ? "Vista" : "2008");
- else if (osversion.dwMinorVersion == 1)
- strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
- ? "7" : "2008 R2");
- else if (osversion.dwMinorVersion == 2)
- strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
- ? "8" : "Server 2012 (not yet supported!)");
+ switch (osversion.dwMinorVersion)
+ {
+ case 0:
+ strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
+ ? "Vista" : "2008");
+ break;
+ case 1:
+ strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
+ ? "7" : "2008 R2");
+ break;
+ default:
+ strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
+ ? "8" : "2012");
+ break;
+ }
DWORD prod;
if (GetProductInfo (osversion.dwMajorVersion,
osversion.dwMinorVersion,