[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 02:53:23 PDT 2024
mstorsjo wrote:
> 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?
I tried testing building compiler-rt with MSVC in 32 bit mode, and it does indeed have the same issue with `SIZE_T` - this patch gets you past the `size_t` mismatches wrt `operator new`, but it still ends up with errors like this:
```
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\basetsd.h(420): error C2371: 'SIZE_T': redefinition; different basic types
C:\code\llvm-project\compiler-rt\lib\interception\interception.h(28): note: see declaration of 'SIZE_T'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\basetsd.h(421): error C2371: 'SSIZE_T': redefinition; different basic types
C:\code\llvm-project\compiler-rt\lib\interception\interception.h(29): note: see declaration of 'SSIZE_T'
```
https://github.com/llvm/llvm-project/pull/106151
More information about the llvm-commits
mailing list