Re: [PATCH 2/5] uname: use only one OSVERSIONINFOEXA struct, use ANSI version

2009-10-01 Thread Paolo Bonzini
On 10/02/2009 02:08 AM, Bruno Haible wrote: Hi Paolo, @@ -42,15 +43,20 @@ uname (struct utsname *buf) if (gethostname (buf->nodename, sizeof (buf->nodename))< 0) strcpy (buf->nodename, "localhost"); - /* Determine major-major Windows version. */ - version.dwOSVersionInfoSize = si

Re: [PATCH 2/5] uname: use only one OSVERSIONINFOEXA struct, use ANSI version

2009-10-01 Thread Bruno Haible
Hi Paolo, > @@ -42,15 +43,20 @@ uname (struct utsname *buf) >if (gethostname (buf->nodename, sizeof (buf->nodename)) < 0) > strcpy (buf->nodename, "localhost"); > > - /* Determine major-major Windows version. */ > - version.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); > - have_vers

Re: [PATCH 2/5] uname: use only one OSVERSIONINFOEXA struct, use ANSI version

2009-10-01 Thread Bruno Haible
Paolo Bonzini wrote: > +#include > + assert (have_version); No assert please. The code which is used by end users should have the same safety built-in than code used by developers. I therefore much prefer code that always verifies the assertions and calls abort() (optionally with an error m

[PATCH 2/5] uname: use only one OSVERSIONINFOEXA struct, use ANSI version

2009-10-01 Thread Paolo Bonzini
This first uname cleanup switches to ANSI functions, and moves all GetVersionEx (now GetVersionExA) calls to the beginning of the function. This way, the calls can share one struct (OSVERSIONINFOEXA begins with the same fields that are in OSVERSIONINFOA). It temporarily asserts that Windows NT can