Skip to content

[22657] Fix log category name macro collision in MacOS (backport #5585) (backport #5595) #5621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.10.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions src/cpp/fastdds/domain/DomainParticipantFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,139 @@ ReturnCode_t DomainParticipantFactory::get_participant_qos_from_profile(
return ReturnCode_t::RETCODE_OK;
}

<<<<<<< HEAD
return ReturnCode_t::RETCODE_BAD_PARAMETER;
=======
return RETCODE_BAD_PARAMETER;
}

ReturnCode_t DomainParticipantFactory::get_participant_qos_from_xml(
const std::string& xml,
DomainParticipantQos& qos) const
{
ParticipantAttributes attr;
if (XMLP_ret::XML_OK == XMLProfileManager::fill_participant_attributes_from_xml(xml, attr, false))
{
qos = default_participant_qos_;
utils::set_qos_from_attributes(qos, attr.rtps);
return RETCODE_OK;
}

return RETCODE_BAD_PARAMETER;
}

ReturnCode_t DomainParticipantFactory::get_participant_qos_from_xml(
const std::string& xml,
DomainParticipantQos& qos,
const std::string& profile_name) const
{
if (profile_name.empty())
{
EPROSIMA_LOG_ERROR(DDS_DOMAIN, "Provided profile name must be non-empty");
return RETCODE_BAD_PARAMETER;
}

ParticipantAttributes attr;
if (XMLP_ret::XML_OK == XMLProfileManager::fill_participant_attributes_from_xml(xml, attr, true, profile_name))
{
qos = default_participant_qos_;
utils::set_qos_from_attributes(qos, attr.rtps);
return RETCODE_OK;
}

return RETCODE_BAD_PARAMETER;
}

ReturnCode_t DomainParticipantFactory::get_default_participant_qos_from_xml(
const std::string& xml,
DomainParticipantQos& qos) const
{
ParticipantAttributes attr;
if (XMLP_ret::XML_OK == XMLProfileManager::fill_default_participant_attributes_from_xml(xml, attr, true))
{
qos = default_participant_qos_;
utils::set_qos_from_attributes(qos, attr.rtps);
return RETCODE_OK;
}

return RETCODE_BAD_PARAMETER;
}

ReturnCode_t DomainParticipantFactory::get_participant_extended_qos_from_profile(
const std::string& profile_name,
DomainParticipantExtendedQos& extended_qos) const
{
ParticipantAttributes attr;
if (XMLP_ret::XML_OK == XMLProfileManager::fillParticipantAttributes(profile_name, attr, false))
{
extended_qos = default_participant_qos_;
utils::set_extended_qos_from_attributes(extended_qos, attr);
return RETCODE_OK;
}

return RETCODE_BAD_PARAMETER;
}

ReturnCode_t DomainParticipantFactory::get_participant_extended_qos_from_xml(
const std::string& xml,
DomainParticipantExtendedQos& extended_qos) const
{
ParticipantAttributes attr;
if (XMLP_ret::XML_OK == XMLProfileManager::fill_participant_attributes_from_xml(xml, attr, false))
{
extended_qos = default_participant_qos_;
utils::set_extended_qos_from_attributes(extended_qos, attr);
return RETCODE_OK;
}

return RETCODE_BAD_PARAMETER;
}

ReturnCode_t DomainParticipantFactory::get_participant_extended_qos_from_xml(
const std::string& xml,
DomainParticipantExtendedQos& extended_qos,
const std::string& profile_name) const
{
if (profile_name.empty())
{
EPROSIMA_LOG_ERROR(DDS_DOMAIN, "Provided profile name must be non-empty");
return RETCODE_BAD_PARAMETER;
}

ParticipantAttributes attr;
if (XMLP_ret::XML_OK == XMLProfileManager::fill_participant_attributes_from_xml(xml, attr, true, profile_name))
{
extended_qos = default_participant_qos_;
utils::set_extended_qos_from_attributes(extended_qos, attr);
return RETCODE_OK;
}

return RETCODE_BAD_PARAMETER;
}

ReturnCode_t DomainParticipantFactory::get_default_participant_extended_qos_from_xml(
const std::string& xml,
DomainParticipantExtendedQos& extended_qos) const
{
ParticipantAttributes attr;
if (XMLP_ret::XML_OK == XMLProfileManager::fill_default_participant_attributes_from_xml(xml, attr, true))
{
extended_qos = default_participant_qos_;
utils::set_extended_qos_from_attributes(extended_qos, attr);
return RETCODE_OK;
}

return RETCODE_BAD_PARAMETER;
}

ReturnCode_t DomainParticipantFactory::get_participant_extended_qos_from_default_profile(
DomainParticipantExtendedQos& extended_qos) const
{
ParticipantAttributes attr;
XMLProfileManager::getDefaultParticipantAttributes(attr);
utils::set_extended_qos_from_attributes(extended_qos, attr);
return RETCODE_OK;
>>>>>>> 55cf7b2a (Fix log category name macro collision in `MacOS` (#5585) (#5595))
}

ReturnCode_t DomainParticipantFactory::load_profiles()
Expand All @@ -343,8 +475,13 @@ ReturnCode_t DomainParticipantFactory::load_XML_profiles_file(
{
if (XMLP_ret::XML_ERROR == XMLProfileManager::loadXMLFile(xml_profile_file))
{
<<<<<<< HEAD
EPROSIMA_LOG_ERROR(DOMAIN, "Problem loading XML file '" << xml_profile_file << "'");
return ReturnCode_t::RETCODE_ERROR;
=======
EPROSIMA_LOG_ERROR(DDS_DOMAIN, "Problem loading XML file '" << xml_profile_file << "'");
return RETCODE_ERROR;
>>>>>>> 55cf7b2a (Fix log category name macro collision in `MacOS` (#5585) (#5595))
}
return ReturnCode_t::RETCODE_OK;
}
Expand All @@ -355,8 +492,13 @@ ReturnCode_t DomainParticipantFactory::load_XML_profiles_string(
{
if (XMLP_ret::XML_ERROR == XMLProfileManager::loadXMLString(data, length))
{
<<<<<<< HEAD
EPROSIMA_LOG_ERROR(DOMAIN, "Problem loading XML string");
return ReturnCode_t::RETCODE_ERROR;
=======
EPROSIMA_LOG_ERROR(DDS_DOMAIN, "Problem loading XML string");
return RETCODE_ERROR;
>>>>>>> 55cf7b2a (Fix log category name macro collision in `MacOS` (#5585) (#5595))
}
return ReturnCode_t::RETCODE_OK;
}
Expand All @@ -367,8 +509,13 @@ ReturnCode_t DomainParticipantFactory::check_xml_static_discovery(
eprosima::fastrtps::xmlparser::XMLEndpointParser parser;
if (XMLP_ret::XML_OK != parser.loadXMLFile(xml_file))
{
<<<<<<< HEAD
EPROSIMA_LOG_ERROR(DOMAIN, "Error parsing xml file");
return ReturnCode_t::RETCODE_ERROR;
=======
EPROSIMA_LOG_ERROR(DDS_DOMAIN, "Error parsing xml file");
return RETCODE_ERROR;
>>>>>>> 55cf7b2a (Fix log category name macro collision in `MacOS` (#5585) (#5595))
}
return ReturnCode_t::RETCODE_OK;
}
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/rtps/RTPSDomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ RTPSParticipant* RTPSDomainImpl::clientServerEnvironmentCreationOverride(
// Check the specified discovery protocol: if other than simple it has priority over ros environment variable
if (att.builtin.discovery_config.discoveryProtocol != DiscoveryProtocol_t::SIMPLE)
{
EPROSIMA_LOG_INFO(DOMAIN, "Detected non simple discovery protocol attributes."
EPROSIMA_LOG_INFO(RTPS_DOMAIN, "Detected non simple discovery protocol attributes."
<< " Ignoring auto default client-server setup.");
return nullptr;
}
Expand Down Expand Up @@ -654,13 +654,13 @@ RTPSParticipant* RTPSDomainImpl::clientServerEnvironmentCreationOverride(
if (nullptr != part)
{
// Client successfully created
EPROSIMA_LOG_INFO(DOMAIN, "Auto default server-client setup. Default client created.");
EPROSIMA_LOG_INFO(RTPS_DOMAIN, "Auto default server-client setup. Default client created.");
part->mp_impl->client_override(true);
return part;
}

// Unable to create auto server-client default participants
EPROSIMA_LOG_ERROR(DOMAIN, "Auto default server-client setup. Unable to create the client.");
EPROSIMA_LOG_ERROR(RTPS_DOMAIN, "Auto default server-client setup. Unable to create the client.");
return nullptr;
}

Expand Down
Loading