On Friday 09 October 2026 11:11:21 LIU Hao wrote:
> 在 2026-10-7 16:39, Pali Rohár 写道:
> > From 39826b539afdfff28a0694c0892c9859cae9ef89 Mon Sep 17 00:00:00 2001
> > From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <[email protected]>
> > Date: Sat, 25 Apr 2026 13:37:42 +0200
> > Subject: [PATCH 2/8] crt: test: Fix t_safe_flush.c test to not crash on 
> > older
> >  Windows versions
> > 
> > This test is indirectly using the IsWindowsVersionOrGreater() function
> > which does not work on older Windows versions on which are missing helper
> > functions.
> > 
> > Provide simple implementation via dynamic loading which allows to use
> > IsWindowsVersionOrGreater() (and other functions which depends on it) with
> > fallback to the implementation via GetVersion() for systems without the
> > IsWindowsVersionOrGreater function symbol.
> > ---
> >  mingw-w64-headers/include/versionhelpers.h | 23 ++++++++++++++++++++--
> >  1 file changed, 21 insertions(+), 2 deletions(-)
> > 
> > diff --git a/mingw-w64-headers/include/versionhelpers.h 
> > b/mingw-w64-headers/include/versionhelpers.h
> > index 35e4d917869d..b55d7471b759 100644
> > --- a/mingw-w64-headers/include/versionhelpers.h
> > +++ b/mingw-w64-headers/include/versionhelpers.h
> > @@ -19,8 +19,27 @@
> >  VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD major, WORD minor, WORD 
> > servpack)
> 
> Does this require a change in the API?

Probably not. But it shows that this inline function
IsWindowsVersionOrGreater() cannot be used on older WinNT versions which
sounds stupid, something which should return BOOL whether os system
version is greater than or not, cause crashing of the whole process.
It would not say it changes API, it just allows to execute this function
also on older WinNT versions. I think that for such "version check"
inline function, this can be a useful change not only for tests.

> You can check whether it's running on
> Vista in the test, for example, by checking whether kernel32.dll exports
> `AcquireSRWLockShared`.


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to