Re: [Mingw-w64-public] [PATCH] headers: Add missing names in shlwapi.h

2021-05-03 Thread Liu Hao
在 2021-05-03 01:53, Biswapriyo Nath 写道: From 3bde731614cf9ea87f75a98752b905785b984485 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Sun, 2 May 2021 23:21:56 +0530 Subject: [PATCH] headers: Add missing names in shlwapi.h Signed-off-by: Biswapriyo Nath ---

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Liu Hao
在 2021-05-03 00:39, Dan Raymond 写道: I don't agree with this.  First: precision and accuracy are two entirely different things so it's important not to use them interchangeably.  It is true that the absolute value of the wall clock time is not likely to be very accurate.  If you are interested

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Martin Storsjö
On Wed, 28 Apr 2021, Liu Hao wrote: 在 4/27/21 2:00 AM, Christian Franke 写道: Which complexity do you mean - the extra cost of the system call or the extra 15 lines of code? Just for the record - I wouldn't mind applying the patch or something like it. I agree with the arguments that it

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Martin Storsjö
On Mon, 3 May 2021, Jacek Caban wrote: I'd say that we should skip it altogether. Atomic operations seem totally redundant in this case. What would it protect from? It won't prevent multiple GetProcAddress calls - for that we'd need a critical section. Since GetProcAddress will always return

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Martin Storsjö
On Mon, 3 May 2021, Liu Hao wrote: 在 2021-05-03 20:52, Martin Storsjö 写道: On Mon, 3 May 2021, Christian Franke wrote: Would plain '... = 0' without cast also work ? IIRC it should since C89 :-) That doesn't work either - clang seems to consider the cast (either implicit or explicit)

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Liu Hao
在 5/4/21 2:48 AM, Martin Storsjö 写道: Sure. However in practice, with e.g. code like this: typedef void (*fp)(void); _Atomic fp ptr1 = ((void(*)(void))0); _Atomic fp ptr2 = ((void*)0); Clang accepts ptr1 but errors out on ptr2: https://gcc.godbolt.org/z/3YW6EsGP4 It looks like a bug. As per

Re: [Mingw-w64-public] [PATCH] crt: Fix the parameter type for UCRT _crt_atexit

2021-05-03 Thread Martin Storsjö
On Sun, 25 Apr 2021, Martin Storsjö wrote: Also move the declaration to corecrt_startup.h, and add a declaration of the corresponding _crt_quick_at_exit. Signed-off-by: Martin Storsjö --- mingw-w64-crt/crt/ucrtbase_compat.c | 5 ++--- mingw-w64-headers/crt/corecrt_startup.h | 2 ++ 2 files

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Liu Hao
在 2021-05-03 14:49, Martin Storsjö 写道: Just for the record - I wouldn't mind applying the patch or something like it. I agree with the arguments that it would be beneficial to get more precision here, even if one in general maybe can argue that we don't strictly need to provide such

Re: [Mingw-w64-public] [PATCH] crt: Implement `at_quick_exit()`

2021-05-03 Thread Martin Storsjö
On Mon, 26 Apr 2021, Liu Hao wrote: 在 2021-04-26 04:20, Martin Storsjö 写道: The exact behaviour for cases 3-5 differ between whether the two are linked dynamically or statically against the CRT. I'm not sure if all the nuances are worth mimicing though. (A function registered with

Re: [Mingw-w64-public] [PATCH] crt: Fix the parameter type for UCRT _crt_atexit

2021-05-03 Thread Liu Hao
在 2021-05-03 15:44, Martin Storsjö 写道: On Sun, 25 Apr 2021, Martin Storsjö wrote: Also move the declaration to corecrt_startup.h, and add a declaration of the corresponding _crt_quick_at_exit. Signed-off-by: Martin Storsjö --- mingw-w64-crt/crt/ucrtbase_compat.c | 5 ++---

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Christian Franke
Liu Hao wrote: 在 2021-04-29 03:34, Christian Franke 写道: BTW.2: The *ftime*() functions from newer versions of MSVC CRT also use GetSystemTimePreciseAsFileTime() if available. UCRTBASE.DLL still uses `GetSystemTimeAsFileTime()`. A test program build with VS2019 and estimation of the

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Martin Storsjö
On Mon, 3 May 2021, Christian Franke wrote: Liu Hao wrote: 在 2021-05-03 14:49, Martin Storsjö 写道: Just for the record - I wouldn't mind applying the patch or something like it. I agree with the arguments that it would be beneficial to get more precision here, even if one in general maybe

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Martin Storsjö
On Mon, 3 May 2021, Martin Storsjö wrote: On Mon, 3 May 2021, Christian Franke wrote: Liu Hao wrote: 在 2021-05-03 14:49, Martin Storsjö 写道: Just for the record - I wouldn't mind applying the patch or something like it. I agree with the arguments that it would be beneficial to get more

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Jacek Caban
On 5/3/21 2:52 PM, Martin Storsjö wrote: On Mon, 3 May 2021, Christian Franke wrote: Would plain '... = 0' without cast also work ? IIRC it should since C89 :-) That doesn't work either - clang seems to consider the cast (either implicit or explicit) between a integer or pointer-to-integer

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Christian Franke
Liu Hao wrote: 在 2021-05-03 14:49, Martin Storsjö 写道: Just for the record - I wouldn't mind applying the patch or something like it. I agree with the arguments that it would be beneficial to get more precision here, even if one in general maybe can argue that we don't strictly need to

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Christian Franke
Martin Storsjö wrote: On Mon, 3 May 2021, Martin Storsjö wrote: On Mon, 3 May 2021, Christian Franke wrote: Liu Hao wrote: 在 2021-05-03 14:49, Martin Storsjö 写道: Just for the record - I wouldn't mind applying the patch or something like it. I agree with the arguments that it would be

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Martin Storsjö
On Mon, 3 May 2021, Christian Franke wrote: Would plain '... = 0' without cast also work ? IIRC it should since C89 :-) That doesn't work either - clang seems to consider the cast (either implicit or explicit) between a integer or pointer-to-integer and a pointer-to-function as something

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Liu Hao
在 2021-05-03 20:30, Christian Franke 写道: Would plain '... = 0' without cast also work ? IIRC it should since C89 :-) Alternative: Leave '/* = 0 */' only as a comment. There is no need to set a static variable to 0. Either using `= 0` as the initializer or omitting it should work. I don't

Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-03 Thread Liu Hao
在 2021-05-03 20:52, Martin Storsjö 写道: On Mon, 3 May 2021, Christian Franke wrote: Would plain '... = 0' without cast also work ? IIRC it should since C89 :-) That doesn't work either - clang seems to consider the cast (either implicit or explicit) between a integer or pointer-to-integer