[Bug]: absl/strings/internal/cord_rep_flat.h(42,39): error C2131: expression did not evaluate to a constant
- Lingua principale
- C++
- Stelle
- 18.1k
- Fork
- 3.2k
- Merge medio
- 20h 36m
- PR unite (30g)
- 1
Descrizione
### Describe the issue
`cord_rep_flat.h` does not compile with MSVC on Windows due to the `offsetof` macro definition in `stddef.h`:
```
// C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stddef.h
#if defined _MSC_VER && !defined _CRT_USE_BUILTIN_OFFSETOF
#ifdef __cplusplus
// This one is used in my setup
#define offsetof(s,m) ((::size_t)&reinterpret_cast((((s*)0)->m)))
#else
#define offsetof(s,m) ((size_t)&(((s*)0)->m))
#endif
#else
#define offsetof(s,m) __builtin_offsetof(s,m)
#endif
```
### Steps to reproduce the problem
```cpp
// Anything that transitively includes
#include
```
### What version of Abseil are you using?
`20230125.3` from conancenter
### What operating system and version are you using?
Windows 11
### What compiler and version are you using?
I *think* I'm using Microsoft (R) C/C++ Optimizing Compiler Version 19.37.32824 for x64 but MSBuild is inscrutable.
### What build system are you using?
CMake 3.27.6
### Additional context
_No response_
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.