mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 21:28:59 +08:00
63 lines
2.3 KiB
Diff
63 lines
2.3 KiB
Diff
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||
|
index 084b6daf..a5501b5b 100644
|
||
|
--- a/CMakeLists.txt
|
||
|
+++ b/CMakeLists.txt
|
||
|
@@ -38,7 +38,6 @@ message(STATUS "\n\n-- ====== Finding Dependencies ======")
|
||
|
# Find Protobuf
|
||
|
set(REQ_PROTOBUF_VER 3)
|
||
|
ign_find_package(IgnProtobuf
|
||
|
- VERSION ${REQ_PROTOBUF_VER}
|
||
|
REQUIRED
|
||
|
PRETTY Protobuf)
|
||
|
|
||
|
diff --git a/include/ignition/transport/RepHandler.hh b/include/ignition/transport/RepHandler.hh
|
||
|
index e826fd6b..4719aa4b 100644
|
||
|
--- a/include/ignition/transport/RepHandler.hh
|
||
|
+++ b/include/ignition/transport/RepHandler.hh
|
||
|
@@ -26,7 +26,7 @@
|
||
|
#pragma warning(pop)
|
||
|
#endif
|
||
|
|
||
|
-#if GOOGLE_PROTOBUF_VERSION > 2999999
|
||
|
+#if GOOGLE_PROTOBUF_VERSION > 2999999 && GOOGLE_PROTOBUF_VERSION < 4022000
|
||
|
#include <google/protobuf/stubs/casts.h>
|
||
|
#endif
|
||
|
|
||
|
@@ -140,7 +140,11 @@ namespace ignition
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
-#if GOOGLE_PROTOBUF_VERSION > 2999999
|
||
|
+#if GOOGLE_PROTOBUF_VERSION >= 4022000
|
||
|
+ auto msgReq =
|
||
|
+ google::protobuf::internal::DownCast<const Req*>(&_msgReq);
|
||
|
+ auto msgRep = google::protobuf::internal::DownCast<Rep*>(&_msgRep);
|
||
|
+#elif GOOGLE_PROTOBUF_VERSION > 2999999
|
||
|
auto msgReq = google::protobuf::down_cast<const Req*>(&_msgReq);
|
||
|
auto msgRep = google::protobuf::down_cast<Rep*>(&_msgRep);
|
||
|
#else
|
||
|
diff --git a/include/ignition/transport/SubscriptionHandler.hh b/include/ignition/transport/SubscriptionHandler.hh
|
||
|
index 96811afe..a8d7ebcd 100644
|
||
|
--- a/include/ignition/transport/SubscriptionHandler.hh
|
||
|
+++ b/include/ignition/transport/SubscriptionHandler.hh
|
||
|
@@ -28,7 +28,7 @@
|
||
|
|
||
|
#include <google/protobuf/stubs/common.h>
|
||
|
|
||
|
-#if GOOGLE_PROTOBUF_VERSION >= 3000000
|
||
|
+#if GOOGLE_PROTOBUF_VERSION >= 3000000 && GOOGLE_PROTOBUF_VERSION < 4022000
|
||
|
#include <google/protobuf/stubs/casts.h>
|
||
|
#endif
|
||
|
|
||
|
@@ -211,7 +211,9 @@ namespace ignition
|
||
|
if (!this->UpdateThrottling())
|
||
|
return true;
|
||
|
|
||
|
-#if GOOGLE_PROTOBUF_VERSION >= 3000000
|
||
|
+#if GOOGLE_PROTOBUF_VERSION >= 4022000
|
||
|
+ auto msgPtr = google::protobuf::internal::DownCast<const T*>(&_msg);
|
||
|
+#elif GOOGLE_PROTOBUF_VERSION >= 3000000
|
||
|
auto msgPtr = google::protobuf::down_cast<const T*>(&_msg);
|
||
|
#else
|
||
|
auto msgPtr = google::protobuf::internal::down_cast<const T*>(&_msg);
|