Re: [Mingw-w64-public] [PATCH] headers: Fix intsafe.h

2024-10-21 Thread Jacek Caban
On 20.10.2024 21:33, David Grayson wrote: Fix ULongToChar to return -1 on overflow, like it does in the SDK. Fix LongLongToUIntPtr and LongLongToULongPtr so they work on 32-bit. Remove about 150 macros added this year that just redefine an existing function. Please consider running the new and

[Mingw-w64-public] [PATCH] headers: Fix intsafe.h

2024-10-20 Thread David Grayson
This patch: - Fixes ULongToChar to return -1 on overflow, like it does in the SDK. - Fixes LongLongToUIntPtr and LongLongToULongPtr so they work on 32-bit. - Removes about 150 macros added this year that just redefine an existing function. The best way to review this might be to just apply it and

Re: [Mingw-w64-public] [PATCH] headers: Fix intsafe.h arithmetic macros on 32-bit targets.

2024-10-18 Thread Jacek Caban
On 18.10.2024 13:59, David Grayson wrote: Hey, original contributor of intsafe.h here. Thank you for fixing this bug, which was introduced in 2019 by someone else. I agree with Martin: let's keep the header short and readable, avoid unneeded ifdefs, define functions in a way that they are obvio

Re: [Mingw-w64-public] [PATCH] headers: Fix intsafe.h arithmetic macros on 32-bit targets.

2024-10-18 Thread David Grayson
Hey, original contributor of intsafe.h here. Thank you for fixing this bug, which was introduced in 2019 by someone else. I agree with Martin: let's keep the header short and readable, avoid unneeded ifdefs, define functions in a way that they are obviously correct on all systems, and not define

Re: [Mingw-w64-public] [PATCH] headers: Fix intsafe.h arithmetic macros on 32-bit targets.

2024-10-18 Thread Martin Storsjö
On Fri, 18 Oct 2024, Jacek Caban wrote: Don't assume that pointer-sized types are long long. Fixes: 0cf06d5cb6968ad71d36a193eeb04f3266bb3aaa Signed-off-by: Jacek Caban --- mingw-w64-headers/include/intsafe.h | 160 +++- 1 file changed, 85 insertions(+), 75 deletions(-)

[Mingw-w64-public] [PATCH] headers: Fix intsafe.h arithmetic macros on 32-bit targets.

2024-10-18 Thread Jacek Caban
Don't assume that pointer-sized types are long long. Fixes: 0cf06d5cb6968ad71d36a193eeb04f3266bb3aaa Signed-off-by: Jacek Caban --- mingw-w64-headers/include/intsafe.h | 160 +++- 1 file changed, 85 insertions(+), 75 deletions(-) diff --git a/mingw-w64-headers/include/