Re: [Mingw-w64-public] [PATCH] Make winpthreads work on Win98

2023-10-23 Thread sotrdg sotrdg
i am still using windows 95

Get Outlook for Android

From: Christian Franke 
Sent: Monday, October 23, 2023 10:05:58 AM
To: mingw-w64-public@lists.sourceforge.net 

Subject: Re: [Mingw-w64-public] [PATCH] Make winpthreads work on Win98

LIU Hao wrote:
> 在 2023/10/23 15:50, Jonathan Schleifer 写道:
>> Could you please explain why a compile time check would be preferable
>> over a runtime check here? The cost of this runtime check should not
>> be noticeable, most likely not even measurable. Doing runtime check
>> seems extremely common on Windows, and I've seen it all over the
>> place for checking functions that were only introduced in Vista. If
>> you grep MinGW code for GetProcAddr, you'll see it be used plenty,
>> including in libwinpthread in src/clock.c, for example. I'm trying to
>> understand what's the difference in clock.c vs. my patch and why it's
>> acceptable there but not in my patch?
>
> Those are probably for hosts that we don't want to drop e.g. Windows
> 7, 2008, Vista, XP. On the other hand, Windows 98 is way too old and I
> haven't seen it used anywhere other than some industrial control
> computers. So this patch adds something that we don't claim to support.
>
> Anyway I am not too against this patch if others agree.

+1 from me because this patch also would bring back support for Win XP
which (at least) also lacks GetTickCount64().

Currently even a C++ "Hello World!" program using std::cout does not run
on Win XP because the C++ exception handling uses this winpthreads module.

--
Regards,
Christian



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

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


Re: [Mingw-w64-public] [PATCH] Make winpthreads work on Win98

2023-10-23 Thread LIU Hao

在 2023-10-23 22:05, Christian Franke 写道:
+1 from me because this patch also would bring back support for Win XP which (at least) also lacks 
GetTickCount64().


Currently even a C++ "Hello World!" program using std::cout does not run on Win XP because the C++ 
exception handling uses this winpthreads module.


Thanks for your opinions. I have pushed this patch to master now.


--
Best regards,
LIU Hao



OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] Make winpthreads work on Win98

2023-10-23 Thread Jonathan Schleifer

Am 23.10.23 um 07:41 schrieb LIU Hao:

Our decision is that the change shall be within a `#if ...` block. 
Whether it is ``#if !defined(_WIN32_WINNT)` or `#if _WIN32_WINNT < 
0x0500` is questionable, but the patch will not be accepted otherwise.


The problem with this is that this is a library that ships with the 
compiler and is required by binaries created by the compiler. This would 
mean the decision which Windows version to target would need to be made 
not when compiling an application, but when compiling the compiler. That 
seems rather bad.


Could you please explain why a compile time check would be preferable 
over a runtime check here? The cost of this runtime check should not be 
noticeable, most likely not even measurable. Doing runtime check seems 
extremely common on Windows, and I've seen it all over the place for 
checking functions that were only introduced in Vista. If you grep MinGW 
code for GetProcAddr, you'll see it be used plenty, including in 
libwinpthread in src/clock.c, for example. I'm trying to understand 
what's the difference in clock.c vs. my patch and why it's acceptable 
there but not in my patch?


BTW I am also curious: does the CRT work well for you? I thought the 
Windows 98 MSVCRT.DLL (?) would have lacked some symbols.


Yes, it works perfectly! With this patch, I'm able to create a single 
.dll for https://objfw.nil.im/ that works all the way from Windows 98 to 
Windows 11, and a single .exe for the test suite that has *all* tests 
pass on Windows 98 to Windows 11 (testing everything from exceptions, 
threads, file system APIs, sockets, etc.). Hence it would really be nice 
to get this patch in, since Windows was always about having one binary 
that works on all versions and #ifdef would be contrary to that.


Thanks,
Jonathan


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


Re: [Mingw-w64-public] [PATCH] Make winpthreads work on Win98

2023-10-23 Thread Christian Franke

LIU Hao wrote:

在 2023/10/23 15:50, Jonathan Schleifer 写道:
Could you please explain why a compile time check would be preferable 
over a runtime check here? The cost of this runtime check should not 
be noticeable, most likely not even measurable. Doing runtime check 
seems extremely common on Windows, and I've seen it all over the 
place for checking functions that were only introduced in Vista. If 
you grep MinGW code for GetProcAddr, you'll see it be used plenty, 
including in libwinpthread in src/clock.c, for example. I'm trying to 
understand what's the difference in clock.c vs. my patch and why it's 
acceptable there but not in my patch?


Those are probably for hosts that we don't want to drop e.g. Windows 
7, 2008, Vista, XP. On the other hand, Windows 98 is way too old and I 
haven't seen it used anywhere other than some industrial control 
computers. So this patch adds something that we don't claim to support.


Anyway I am not too against this patch if others agree.


+1 from me because this patch also would bring back support for Win XP 
which (at least) also lacks GetTickCount64().


Currently even a C++ "Hello World!" program using std::cout does not run 
on Win XP because the C++ exception handling uses this winpthreads module.


--
Regards,
Christian



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


Re: [Mingw-w64-public] [PATCH] Make winpthreads work on Win98

2023-10-23 Thread Martin Storsjö

On Mon, 23 Oct 2023, LIU Hao wrote:


在 2023/10/23 15:50, Jonathan Schleifer 写道:
Could you please explain why a compile time check would be preferable 
over a runtime check here? The cost of this runtime check should not be 
noticeable, most likely not even measurable. Doing runtime check seems 
extremely common on Windows, and I've seen it all over the place for 
checking functions that were only introduced in Vista. If you grep 
MinGW code for GetProcAddr, you'll see it be used plenty, including in 
libwinpthread in src/clock.c, for example. I'm trying to understand 
what's the difference in clock.c vs. my patch and why it's acceptable 
there but not in my patch?


Ah, I didn't remember we already had such a case. The new codepaths, using 
__attribute__((constructor)), probably are good here, and arguably at 
least as safe as the existing case (which does the init lazily, accessed 
with atomics).


Those are probably for hosts that we don't want to drop e.g. Windows 7, 
2008, Vista, XP. On the other hand, Windows 98 is way too old and I 
haven't seen it used anywhere other than some industrial control 
computers. So this patch adds something that we don't claim to support.


Anyway I am not too against this patch if others agree.


Yeah, it's outside of what we actively support, but the patch seems 
acceptable on a second though, as we already have GetProcAddr cases here.


// Martin

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


Re: [Mingw-w64-public] [PATCH] Make winpthreads work on Win98

2023-10-23 Thread LIU Hao

在 2023/10/23 15:50, Jonathan Schleifer 写道:
Could you please explain why a compile time check would be preferable over a runtime check here? The 
cost of this runtime check should not be noticeable, most likely not even measurable. Doing runtime 
check seems extremely common on Windows, and I've seen it all over the place for checking functions 
that were only introduced in Vista. If you grep MinGW code for GetProcAddr, you'll see it be used 
plenty, including in libwinpthread in src/clock.c, for example. I'm trying to understand what's the 
difference in clock.c vs. my patch and why it's acceptable there but not in my patch?


Those are probably for hosts that we don't want to drop e.g. Windows 7, 2008, Vista, XP. On the 
other hand, Windows 98 is way too old and I haven't seen it used anywhere other than some industrial 
control computers. So this patch adds something that we don't claim to support.


Anyway I am not too against this patch if others agree.


--
Best regards,
LIU Hao



OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public