bug-gnulib
[Top][All Lists]
Advanced

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

Re: gettimeofday.c windows version?


From: Bruno Haible
Subject: Re: gettimeofday.c windows version?
Date: Sun, 11 Dec 2022 17:20:07 +0100

Hi Eli,

> Emacs still supports even Windows 9X.  And mingw.org's MinGW does the
> same.  Which is why Emacs avoids using Gnulib functions that use APIs
> which aren't available on older Windows versions.
> 
> > And should Gnulib declare that the minimum supported version of Windows
> > is Windows 8?
> 
> I hope you won't, but it's your decision.

Thanks for your answers.

Well, it's a trade-off regarding the test efforts. I don't want to spend
time, testing things on 5 different Windows VMs. Testing things with
3 different Windows toolchains in 2 different bitnesses is already work
enough.

> I think the code should use a run-time check regardless of the version
> of Windows on which the program was compiled.

But the value of _WIN32_WINNT is not the version *on* which the program was
compiled. It is the minimum version *for* which the program was compiled.
Both the INSTALL.windows of some GNU packages, as well as
 
<https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt>,
say so. Maybe we should emphasize this in the install documentation even more?

> So IMO only the prototype of GetSystemTimePreciseAsFileTime should be
> conditioned by the value of _WIN32_WINNT, but the 'initialize'
> function should be run on all versions of Windows.

As some point, I want to get rid of the initialize() function and assume
a new enough version of the OS.

For decades we had old cruft in our source code, that tested whether <stdlib.h>
was available, whether 'long long' was available, and so on. This bloats the
code, and with the day this cruft can be removed, the maintenance becomes
simpler. The same holds for backward-compatibility code that does LoadLibrary
and GetProcAddress.

Bruno






reply via email to

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