vcpkg/ports/protobuf/port_def.patch
Max Golovanov 7d472dd258
[protobuf] Protobuf no longer compiles with vs2019 Update 16.10 w/ c++latest (#18251)
* Create port_def.patch

Patch to turn off constinit with Visual Studio 2019 Update 16.10

* Update portfile.cmake

Apply port_def.patch

* Update vcpkg.json

Increment port-version

* Add version
2021-06-10 16:32:11 -07:00

15 lines
652 B
Diff

diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
index f7b64a080..3493d9082 100644
--- a/src/google/protobuf/port_def.inc
+++ b/src/google/protobuf/port_def.inc
@@ -564,7 +564,8 @@
// Our use of constinit does not yet work with GCC:
// https://github.com/protocolbuffers/protobuf/issues/8310
-#if defined(__cpp_constinit) && !defined(__GNUC__)
+// Does not work yet with Visual Studio 2019 Update 16.10
+#if defined(__cpp_constinit) && !defined(__GNUC__) && !defined(_MSC_VER)
#define PROTOBUF_CONSTINIT constinit
#elif defined(__has_cpp_attribute)
#if __has_cpp_attribute(clang::require_constant_initialization)