abseil / abseil/abseil-cpp

[Bug]: absl/strings/internal/cord_rep_flat.h(42,39): error C2131: expression did not evaluate to a constant

Abierto
#1,554 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C++
Estrellas
18.1k
Forks
3.2k
Merge medio
20 h 36 min
PR fusionados (30 d)
1

Descripción

### 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_

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.