[compiler-rt] [compiler-rt] Fix definition of `uptr` (and `usize`) on 32-bit Windows (PR #106151)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 27 00:58:39 PDT 2024
mstorsjo wrote:
Also, MSVC/WinSDK headers also have the exact same setup for these basic types. From basetsd.h in WinSDK:
```
#if defined(_WIN64)
typedef __int64 INT_PTR, *PINT_PTR;
typedef unsigned __int64 UINT_PTR, *PUINT_PTR;
typedef __int64 LONG_PTR, *PLONG_PTR;
typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
#define __int3264 __int64
#else
typedef _W64 int INT_PTR, *PINT_PTR;
typedef _W64 unsigned int UINT_PTR, *PUINT_PTR;
typedef _W64 long LONG_PTR, *PLONG_PTR;
typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR;
#define __int3264 __int32
#endif
[...]
typedef ULONG_PTR SIZE_T, *PSIZE_T;
typedef LONG_PTR SSIZE_T, *PSSIZE_T;
```
So I'm not quite sure how using `unsigned int` for `__sanitizer::uptr` works on MSVC/i386, with respect to the redefinition of `SIZE_T`? Or is the case that when `interception.h` is included in MSVC mode, the transitive system header includes that pull in `SIZE_T` don't end up included, and we can do our own conflicting definition?
https://github.com/llvm/llvm-project/pull/106151
More information about the llvm-commits
mailing list