Cygwin suppresses uintptr_t typedefs to avoid polluting its own CRT
headers. This breaks any use of the type, yet including stdint.h further
pollutes the namespace.
Use __UINTPTR_TYPE__ directly in _invalid_parameter and _invoke_watson
since it is supported by both gcc and clang.
Patch OK for master branch?
From 5e9b867fa8f6c812f68bba2615cbe22d880cd29e Mon Sep 17 00:00:00 2001
From: Jonathan Yong <[email protected]>
Date: Sat, 28 Feb 2026 03:53:38 +0000
Subject: [PATCH] mingw-w64-headers/crt/corecrt.h: fix cygwin w32api usage
Cygwin suppresses uintptr_t typedefs to avoid polluting its own
CRT headers. This breaks any use of the type, yet including stdint.h
further pollutes the namespace.
Use __UINTPTR_TYPE__ directly in _invalid_parameter and _invoke_watson
since it is supported by both gcc and clang.
Signed-off-by: Jonathan Yong <[email protected]>
---
mingw-w64-headers/crt/corecrt.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mingw-w64-headers/crt/corecrt.h b/mingw-w64-headers/crt/corecrt.h
index d28167c01..2b6371d52 100644
--- a/mingw-w64-headers/crt/corecrt.h
+++ b/mingw-w64-headers/crt/corecrt.h
@@ -152,11 +152,11 @@ typedef __time64_t time_t;
#endif
#ifdef _DEBUG
-_CRTIMP void __cdecl _invalid_parameter(const wchar_t *expression, const wchar_t *function_name, const wchar_t *file_name, unsigned int line_number, uintptr_t reserved);
+_CRTIMP void __cdecl _invalid_parameter(const wchar_t *expression, const wchar_t *function_name, const wchar_t *file_name, unsigned int line_number, __UINTPTR_TYPE__ reserved);
#endif
_CRTIMP void __cdecl _invalid_parameter_noinfo(void);
_CRTIMP __MINGW_ATTRIB_NORETURN void __cdecl _invalid_parameter_noinfo_noreturn(void);
-_CRTIMP __MINGW_ATTRIB_NORETURN void __cdecl _invoke_watson(const wchar_t *expression, const wchar_t *function_name, const wchar_t *file_name, unsigned int line_number, uintptr_t reserved);
+_CRTIMP __MINGW_ATTRIB_NORETURN void __cdecl _invoke_watson(const wchar_t *expression, const wchar_t *function_name, const wchar_t *file_name, unsigned int line_number, __UINTPTR_TYPE__ reserved);
#if defined(__cplusplus) && _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES
--
2.53.0
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public