There was an error while loading. Please reload this page.
1 parent 562d913 commit a430093Copy full SHA for a430093
1 file changed
core/include/gz/msgs/detail/dynamic_message_cast.hh
@@ -37,7 +37,12 @@ template<typename MsgT>
37
std::unique_ptr<MsgT>
38
dynamic_message_cast(std::unique_ptr<google::protobuf::Message> &&_baseMsg)
39
{
40
+#if GOOGLE_PROTOBUF_VERSION >= 5028000
41
+ auto converted = std::unique_ptr<MsgT>{
42
+ google::protobuf::DynamicCastMessage<MsgT>(_baseMsg.get())};
43
+#else
44
auto converted = std::unique_ptr<MsgT>{dynamic_cast<MsgT*>(_baseMsg.get())};
45
+#endif
46
if (converted) {
47
(void) _baseMsg.release();
48
}
0 commit comments