From 9aeed785ff699c40bbd323aed60358729c7710c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20S=C3=A1nchez-Mateos=20Lizano?= Date: Wed, 7 Aug 2024 10:02:14 +0200 Subject: [PATCH 1/4] Refs #21469: Fix Debug build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raúl Sánchez-Mateos Lizano --- examples/cpp/rtps/CLIParser.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/cpp/rtps/CLIParser.hpp b/examples/cpp/rtps/CLIParser.hpp index 507c13e5739..1f95f81b851 100644 --- a/examples/cpp/rtps/CLIParser.hpp +++ b/examples/cpp/rtps/CLIParser.hpp @@ -131,7 +131,6 @@ class CLIParser if (static_cast(input) > std::numeric_limits::max()) { throw std::out_of_range("sample argument out of range"); - print_help(EXIT_FAILURE); } config.samples = static_cast(input); From 7046ae1b1bf9002473513a7e74059d16ca2e8c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20S=C3=A1nchez-Mateos=20Lizano?= Date: Wed, 7 Aug 2024 12:03:19 +0200 Subject: [PATCH 2/4] Refs #21469: Fix windows crash in flow controller example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raúl Sánchez-Mateos Lizano --- examples/cpp/flow_control/PublisherApp.cpp | 12 +++++++++--- examples/cpp/flow_control/PublisherApp.hpp | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/cpp/flow_control/PublisherApp.cpp b/examples/cpp/flow_control/PublisherApp.cpp index cec9601282d..ed8771dda63 100644 --- a/examples/cpp/flow_control/PublisherApp.cpp +++ b/examples/cpp/flow_control/PublisherApp.cpp @@ -191,7 +191,10 @@ void PublisherApp::run() } else { - throw std::runtime_error("Slow Publisher failed sending a message"); + if (!is_stopped()) + { + std::cout << "Slow Publisher failed sending a message" << std::endl; + } } if (publish(fast_writer_, msg)) @@ -200,7 +203,10 @@ void PublisherApp::run() } else { - throw std::runtime_error("Fast Publisher failed sending a message"); + if (!is_stopped()) + { + std::cout << "Fast Publisher failed sending a message" << std::endl; + } } // Wait for period or stop event @@ -214,7 +220,7 @@ void PublisherApp::run() bool PublisherApp::publish( DataWriter* writer_, - FlowControl msg) + FlowControl& msg) { bool ret = false; // Wait for the data endpoints discovery diff --git a/examples/cpp/flow_control/PublisherApp.hpp b/examples/cpp/flow_control/PublisherApp.hpp index 9e5749b46fe..037aff94848 100644 --- a/examples/cpp/flow_control/PublisherApp.hpp +++ b/examples/cpp/flow_control/PublisherApp.hpp @@ -72,7 +72,7 @@ class PublisherApp : public Application, public DataWriterListener //! Publish a sample bool publish( DataWriter* writer_, - FlowControl msg); + FlowControl& msg); DomainParticipant* participant_; From f78333c6851da4d1b795ffc303c12dd9277835e8 Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Wed, 7 Aug 2024 13:48:57 +0200 Subject: [PATCH 3/4] Refs #21469: Set extensibility explicitly Signed-off-by: JesusPoderoso --- examples/cpp/flow_control/FlowControl.idl | 1 + examples/cpp/flow_control/FlowControlTypeObjectSupport.cxx | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/examples/cpp/flow_control/FlowControl.idl b/examples/cpp/flow_control/FlowControl.idl index 27c1222a81a..ec04129bc11 100644 --- a/examples/cpp/flow_control/FlowControl.idl +++ b/examples/cpp/flow_control/FlowControl.idl @@ -1,3 +1,4 @@ +@extensibility(APPENDABLE) struct FlowControl { unsigned long index; diff --git a/examples/cpp/flow_control/FlowControlTypeObjectSupport.cxx b/examples/cpp/flow_control/FlowControlTypeObjectSupport.cxx index b6bd4eb53f3..c4da3940884 100644 --- a/examples/cpp/flow_control/FlowControlTypeObjectSupport.cxx +++ b/examples/cpp/flow_control/FlowControlTypeObjectSupport.cxx @@ -54,6 +54,13 @@ void register_FlowControl_type_identifier( QualifiedTypeName type_name_FlowControl = "FlowControl"; eprosima::fastcdr::optional type_ann_builtin_FlowControl; eprosima::fastcdr::optional ann_custom_FlowControl; + AppliedAnnotationSeq tmp_ann_custom_FlowControl; + eprosima::fastcdr::optional verbatim_FlowControl; + if (!tmp_ann_custom_FlowControl.empty()) + { + ann_custom_FlowControl = tmp_ann_custom_FlowControl; + } + CompleteTypeDetail detail_FlowControl = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_FlowControl, ann_custom_FlowControl, type_name_FlowControl.to_string()); CompleteStructHeader header_FlowControl; header_FlowControl = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_FlowControl); From 74915ef9909ab3291df8c9d3f6e5a49cc49d623d Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Thu, 8 Aug 2024 10:54:59 +0200 Subject: [PATCH 4/4] Refs #21469: Apply Mario's proposal Signed-off-by: JesusPoderoso --- examples/cpp/flow_control/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/cpp/flow_control/CMakeLists.txt b/examples/cpp/flow_control/CMakeLists.txt index 056172f9f8d..f84047b8517 100644 --- a/examples/cpp/flow_control/CMakeLists.txt +++ b/examples/cpp/flow_control/CMakeLists.txt @@ -47,6 +47,9 @@ target_compile_definitions(flow_control PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) +if(WIN32) + set_target_properties(flow_control PROPERTIES LINK_FLAGS /STACK:4194304) +endif() target_link_libraries(flow_control fastdds fastcdr foonathan_memory) install(TARGETS flow_control RUNTIME DESTINATION ${DATA_INSTALL_DIR}/fastdds/examples/cpp/flow_control/${BIN_INSTALL_DIR})