vsomeip icon indicating copy to clipboard operation
vsomeip copied to clipboard

support boost version 1.78.0

Open sensokame opened this issue 3 years ago • 2 comments

supporting the latest version of boost would be really beneficial, specially since this version is compatible with visual studio 2022

sensokame avatar Apr 06 '22 15:04 sensokame

I get it to build with

Index: git/CMakeLists.txt
===================================================================
--- git.orig/CMakeLists.txt
+++ git/CMakeLists.txt
@@ -164,7 +164,7 @@ else()
 endif()
 
 message( STATUS "Using boost version: ${VSOMEIP_BOOST_VERSION}" )
-if (${VSOMEIP_BOOST_VERSION} GREATER 107600)
+if (${VSOMEIP_BOOST_VERSION} GREATER 107900)
 message( ERROR "boost version ${VSOMEIP_BOOST_VERSION} is not (yet) supported. Latest supported version is 1.76.0" )
 elseif(${VSOMEIP_BOOST_VERSION} GREATER 107500)
 set(VSOMEIP_BOOST_HELPER implementation/helper/1.76)
Index: git/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext_local.hpp
===================================================================
--- git.orig/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext_local.hpp
+++ git/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext_local.hpp
@@ -66,7 +71,7 @@ template <typename Handler>
 auto zero_arg_copyable_handler_test(Handler h, void*)
   -> decltype(
     sizeof(Handler(static_cast<const Handler&>(h))),
-    ((h)()),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)()),
     char(0));
 
 template <typename Handler>
@@ -76,7 +81,7 @@ template <typename Handler, typename Arg
 auto one_arg_handler_test(Handler h, Arg1* a1)
   -> decltype(
     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
-    ((h)(*a1)),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)(*a1)),
     char(0));
 
 template <typename Handler>
@@ -86,7 +91,7 @@ template <typename Handler, typename Arg
 auto two_arg_handler_test(Handler h, Arg1* a1, Arg2* a2)
   -> decltype(
     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
-    ((h)(*a1, *a2)),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)(*a1, *a2)),
     char(0));
 
 template <typename Handler>
@@ -96,7 +101,8 @@ template <typename Handler, typename Arg
 auto two_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2)
   -> decltype(
     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
-    ((h)(*a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2))),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)(
+      *a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2))),
     char(0));
 
 template <typename Handler>
@@ -106,7 +112,7 @@ template <typename Handler, typename Arg
 auto four_arg_handler_test(Handler h, Arg1* a1, Arg2* a2, Arg3* a3, Arg4* a4)
   -> decltype(
     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
-    ((h)(*a1, *a2, *a3, *a4)),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)(*a1, *a2, *a3, *a4)),
     char(0));
 
 template <typename Handler>
@@ -116,7 +122,7 @@ template <typename Handler, typename Arg
 auto four_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2, Arg3* a3, Arg4* a4)
   -> decltype(
     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
-    ((h)(*a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2), BOOST_ASIO_MOVE_CAST(Arg3)(*a3), BOOST_ASIO_MOVE_CAST(Arg4)(*a4))),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)(*a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2), BOOST_ASIO_MOVE_CAST(Arg3)(*a3), BOOST_ASIO_MOVE_CAST(Arg4)(*a4))),
     char(0));
 
 template <typename Handler>
Index: git/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext.hpp
===================================================================
--- git.orig/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext.hpp
+++ git/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext.hpp
@@ -66,7 +71,7 @@ template <typename Handler>
 auto zero_arg_copyable_handler_test(Handler h, void*)
   -> decltype(
     sizeof(Handler(static_cast<const Handler&>(h))),
-    ((h)()),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)()),
     char(0));
 
 template <typename Handler>
@@ -76,7 +81,7 @@ template <typename Handler, typename Arg
 auto one_arg_handler_test(Handler h, Arg1* a1)
   -> decltype(
     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
-    ((h)(*a1)),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)(*a1)),
     char(0));
 
 template <typename Handler>
@@ -86,7 +91,7 @@ template <typename Handler, typename Arg
 auto two_arg_handler_test(Handler h, Arg1* a1, Arg2* a2)
   -> decltype(
     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
-    ((h)(*a1, *a2)),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)(*a1, *a2)),
     char(0));
 
 template <typename Handler>
@@ -96,7 +101,8 @@ template <typename Handler, typename Arg
 auto two_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2)
   -> decltype(
     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
-    ((h)(*a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2))),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)(
+      *a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2))),
     char(0));
 
 template <typename Handler>
@@ -106,7 +112,7 @@ template <typename Handler, typename Arg
 auto three_arg_handler_test(Handler h, Arg1* a1, Arg2* a2, Arg3* a3)
   -> decltype(
     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
-    ((h)(*a1, *a2, *a3)),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)(*a1, *a2, *a3)),
     char(0));
 
 template <typename Handler>
@@ -116,7 +122,7 @@ template <typename Handler, typename Arg
 auto three_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2, Arg3 *a3)
   -> decltype(
     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
-    ((h)(*a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2), BOOST_ASIO_MOVE_CAST(Arg3)(*a3))),
+    (BOOST_ASIO_MOVE_OR_LVALUE(Handler)(h)(*a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2), BOOST_ASIO_MOVE_CAST(Arg3)(*a3))),
     char(0));
 
 template <typename Handler>

Only build with boost-1.78 tested; but not whether it still compiles with boost-1.76 nor whether 'vsomeip' works at all

ensc avatar May 10 '22 10:05 ensc

@ensc thank you for your suggestions, with it I managed to build vsomeip on windows using boost 1.79

however on linux I ran into an error I couldn't fix (I don't have a lot of experience in cpp)

basically basic_stream_socket_ext.hpp has async_write_some function which calls async_initiate, but this call when building throws a "no matching function for call"

any idea how to fix that?

sensokame avatar Jul 13 '22 15:07 sensokame

Fixed on version 3.3.0 (master branch).

goncaloalmeida avatar Mar 15 '23 17:03 goncaloalmeida