On Saturday 14 September 2024 23:51:40 Martin Storsjö wrote:
> On Sun, 8 Sep 2024, Pali Rohár wrote:
> 
> > Global variable _osplatform is provided in new x86 versions of msvcrt.dll
> 
> I think this misses explaining what the situation is for other
> architectures.

Ou, I forget for it.

> For x64, it is available everywhere, right?

Yes.

> And for arm/arm64, neither the variable nor the __p_ function is available, 
> right?

Exactly.

> 
> The msvcrt.dll i386 version contains a fallback implementation that is
> implemented in terms of GetVersionExA. _If_ there would be a lot of reasons
> for using _osplatform on arm versions of msvcrt, I guess such a fallback
> could be useful there as well?

Yes, I was planning to prepare _osplatform, _osver, _winmajor, _winminor
and _winver also for ARM as well as UCRT after this change.

> But as very few things touch these variables
> (that aren't available on UCRT anyway, right?), it's probably not worth
> doing that.

It is not available neither in UCRT.

> > and then also in msvcr70.dll, msvcr71.dll and msvcr80.dll. Function
> > __p__osplatform() which returns pointer to global variable _osplatform is
> > provided only in msvcr80.dll.
> > 
> > Provide missing function __p__osplatform() for x86 versions of msvcrt.dll,
> > msvcr70.dll and msvcr71.dll and change definition of _osplatform in header
> > file to use __p__osplatform() function. This aligns definition with msvc
> > and avoid referencing another global variable from mingw-w64 header files.
> > ---
> > mingw-w64-crt/Makefile.am            |  4 +++
> > mingw-w64-crt/misc/__p__osplatform.c | 48 ++++++++++++++++++++++++++++
> > mingw-w64-headers/crt/stdlib.h       |  9 +++---
> > 3 files changed, 56 insertions(+), 5 deletions(-)
> > create mode 100644 mingw-w64-crt/misc/__p__osplatform.c
> 
> I think the patch looks reasonable, but I want to check the assumptions
> above before pushing.
> 
> // Martin


_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to