bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/5] Handle Windows CE and rewrite NT version handling.


From: Paolo Bonzini
Subject: Re: [PATCH 4/5] Handle Windows CE and rewrite NT version handling.
Date: Fri, 02 Oct 2009 02:28:50 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3


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.

And even operating systems that were never ported? Windows 95/98/ME _cannot_ be ported to other processors than x86 because of its architecture (for the same reason why Wine cannot be ported to other processors than x86).

+       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.

I'll make it only Windows Server/Windows.

+      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.

But you do see the 5/0, 5/1, 5/2, 6/0, 6/1 pairs. I did it all but to save instructions. It was more readable for me.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]