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 <[email protected]>
---
mingw-w64-headers/include/intsafe.h | 160 +++++++++++++++-------------
1 file changed, 85 insertions(+), 75 deletions(-)
Hmm, this patch is a bit hard to review, as a lot of the patch is just
restructuring the existing definitions.
Also, I have a hard time figuring out the reason for doing things this
way. E.g. this:
+#ifdef _WIN64
+#define ULongPtrAdd ULongLongAdd
+#define DWordPtrAdd ULongLongAdd
+#define IntPtrAdd LongLongAdd
+#else
__MINGW_INTSAFE_API __MINGW_INTSAFE_MATH(ULongPtrAdd, ULONG_PTR, add)
__MINGW_INTSAFE_API __MINGW_INTSAFE_MATH(DWordPtrAdd, DWORD_PTR, add)
__MINGW_INTSAFE_API __MINGW_INTSAFE_MATH(IntPtrAdd, INT_PTR, add)
+#endif
-#define ULongPtrAdd ULongLongAdd
-#define DWordPtrAdd ULongLongAdd
-#define IntPtrAdd LongLongAdd
Wouldn't the preexisting declarations, using __MINGW_INTSAFE_MATH() with
ULONG_PTR, DWORD_PTR and INT_PTR etc, be correct for both 32 and 64 bit
environments, if we'd just remove the incorrect defines at the end?
// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public