Files
rippled/external/protobuf/patches/protobuf-6.30.1-disable-fixed-string-MSVC.patch
Bronek Kozicki 6ba0ec479b Add external/protobuf
Only needed until this PR is merged
https://github.com/conan-io/conan-center-index/pull/27982
2025-07-24 12:21:05 +01:00

22 lines
838 B
Diff

diff --git a/src/google/protobuf/port.h b/src/google/protobuf/port.h
index 386ecc02a..32d260c42 100644
--- a/src/google/protobuf/port.h
+++ b/src/google/protobuf/port.h
@@ -502,10 +502,16 @@ class alignas(8) GlobalEmptyStringConstexpr {
// Nothing to init, or destroy.
std::string* Init() const { return nullptr; }
+ // Disable the optimization for MSVC.
+ // There are some builds where the default constructed string can't be used as
+ // `constinit` even though the constructor is `constexpr` and can be used
+ // during constant evaluation.
+#if !defined(_MSC_VER)
template <typename T = std::string, bool = (T(), true)>
static constexpr std::true_type HasConstexprDefaultConstructor(int) {
return {};
}
+#endif
static constexpr std::false_type HasConstexprDefaultConstructor(char) {
return {};
}