At the same time, Windows 95/98/ME never supported anything but 32-bit
x86, so its section can be simplified.
There is no need to "simplify" here. The goal of this uname() function is
to support all kinds of machines, even those to which we don't have
access to.
+ default: /* 3.5, 4.0, versions not yet known */
+ sprintf (buf->release, "Windows NT %s %u.%u",
+ is_server ? "Server" : "Workstation",
+ (unsigned int) version.dwMajorVersion,
+ (unsigned int) version.dwMinorVersion);
I object against outputting "Windows NT" for the versions not yet known
(Windows 7, 8, who knows?). Returning "Windows" is suboptimal, but
acceptable. Returning "Windows NT" will be confusing for end users.
+ switch ((version.dwMajorVersion<< 8)
+ | version.dwMinorVersion)
An idiom like this may save a couple of instructions at the expense of
readability of the code. When I look at the MS documentation of
OSVERSIONINFOEX, I see values 5, 6 mentioned, but I don't see 0x502,
0x601 etc. Consequence: This idiom makes the code harder to maintain.