From fe5852514a5cf82a3fadec6b9458caf134c451f1 Mon Sep 17 00:00:00 2001 From: Cheney Wang <38240633+Cheney-W@users.noreply.github.com> Date: Fri, 18 Dec 2020 13:20:39 +0800 Subject: [cppmicroservices] Fix warning C4834 (#15177) Co-authored-by: Cheney-Wang --- ports/cppmicroservices/CONTROL | 3 ++- ports/cppmicroservices/fix-warning-c4834.patch | 25 +++++++++++++++++++++++++ ports/cppmicroservices/portfile.cmake | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 ports/cppmicroservices/fix-warning-c4834.patch (limited to 'ports/cppmicroservices') diff --git a/ports/cppmicroservices/CONTROL b/ports/cppmicroservices/CONTROL index 91748199f..2db76b91d 100644 --- a/ports/cppmicroservices/CONTROL +++ b/ports/cppmicroservices/CONTROL @@ -1,5 +1,6 @@ Source: cppmicroservices -Version: 3.4.0-1 +Version: 3.4.0 +Port-Version: 2 Homepage: https://github.com/CppMicroServices/CppMicroServices Description: An OSGi-like C++ dynamic module system and service registry Build-Depends: gtest \ No newline at end of file diff --git a/ports/cppmicroservices/fix-warning-c4834.patch b/ports/cppmicroservices/fix-warning-c4834.patch new file mode 100644 index 000000000..893b28d30 --- /dev/null +++ b/ports/cppmicroservices/fix-warning-c4834.patch @@ -0,0 +1,25 @@ +diff --git a/httpservice/src/ServletContainer.cpp b/httpservice/src/ServletContainer.cpp +index b4af8c9..8713066 100644 +--- a/httpservice/src/ServletContainer.cpp ++++ b/httpservice/src/ServletContainer.cpp +@@ -279,7 +279,9 @@ void ServletContainer::SetContextPath(const std::string& path) + + std::string ServletContainer::GetContextPath() const + { +- return Lock(d->m_Mutex), d->m_ContextPath; ++ Lock l(d->m_Mutex); ++ US_UNUSED(l); ++ return d->m_ContextPath; + } + + void ServletContainer::Start() +@@ -306,6 +308,8 @@ std::shared_ptr ServletContainer::GetContext( + std::string ServletContainer::GetContextPath( + const ServletContext* /*context*/) const + { +- return Lock(d->m_Mutex), d->m_ContextPath; ++ Lock l(d->m_Mutex); ++ US_UNUSED(l); ++ return d->m_ContextPath; + } + } diff --git a/ports/cppmicroservices/portfile.cmake b/ports/cppmicroservices/portfile.cmake index 47df1e14e..47c209a87 100644 --- a/ports/cppmicroservices/portfile.cmake +++ b/ports/cppmicroservices/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( PATCHES werror.patch fix-dependency-gtest.patch + fix-warning-c4834.patch ) vcpkg_configure_cmake( @@ -22,7 +23,6 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - vcpkg_fixup_cmake_targets() # Handle copyright -- cgit v1.2.3