Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Fix" Visual Studio 17 constinit issues #10231

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/google/protobuf/port_def.inc
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,10 @@
// Used to remove the manipulation of cleared elements in RepeatedPtrField.
// Owner: mkruskal@
#define PROTOBUF_FUTURE_REMOVE_CLEARED_API 1
<<<<<<< HEAD
=======

// Used to escape C++20 keywords.
// Owner: mkruskal@
#define PROTOBUF_FUTURE_CPP20_KEYWORDS 1
>>>>>>> 87d285c785cd1a4334e3e21e5d468a9bc3e85f62
#else
#define PROTOBUF_FUTURE_FINAL
#endif
Expand Down Expand Up @@ -667,7 +664,7 @@
#ifdef PROTOBUF_CONSTINIT
#error PROTOBUF_CONSTINIT was previously defined
#endif
#if defined(__cpp_constinit)
#if defined(__cpp_constinit) && !defined(_MSC_VER)
#define PROTOBUF_CONSTINIT constinit
#define PROTOBUF_CONSTEXPR constexpr
// Some older Clang versions incorrectly raise an error about
Expand All @@ -682,6 +679,10 @@
#elif PROTOBUF_GNUC_MIN(12, 2)
#define PROTOBUF_CONSTINIT __constinit
#define PROTOBUF_CONSTEXPR constexpr
// MSVC 17 currently seems to raise an error about constant-initialized pointers.
#elif defined(_MSC_VER) && _MSC_VER >= 1930
#define PROTOBUF_CONSTINIT
#define PROTOBUF_CONSTEXPR constexpr
#else
#define PROTOBUF_CONSTINIT
#define PROTOBUF_CONSTEXPR
Expand Down