Skip to content
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

[boost] add patch for 1.72 #712

Merged
merged 7 commits into from
Feb 21, 2020
Merged
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
2 changes: 2 additions & 0 deletions recipes/boost/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ patches:
base_path: "boost_1_72_0"
- patch_file: "patches/solaris_pthread_data.patch"
base_path: "boost_1_72_0"
- patch_file: "patches/0001-revert-cease-dependence-on-range.patch"
base_path: "boost_1_72_0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From 188eac4acf37313fcec27d7b266c6517b99ed23d Mon Sep 17 00:00:00 2001
From: Oliver Kowalke <oliver.kowalke@gmail.com>
Date: Sun, 1 Dec 2019 20:40:28 +0100
Subject: [PATCH] Revert "Cease dependence on Range"

This reverts commit 0c556bb59241e682bbcd3f572815149c5a9b17db.

see #44 (One test fails to compile after boostorg/coroutine submodule updated)
---
boost/coroutine/asymmetric_coroutine.hpp | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/boost/coroutine/asymmetric_coroutine.hpp b/boost/coroutine/asymmetric_coroutine.hpp
index f2ae16f..78b1842 100644
--- a/boost/coroutine/asymmetric_coroutine.hpp
+++ b/boost/coroutine/asymmetric_coroutine.hpp
@@ -14,6 +14,7 @@
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/move/move.hpp>
+#include <boost/range.hpp>
#include <boost/throw_exception.hpp>
#include <boost/utility/explicit_operator_bool.hpp>

@@ -2390,19 +2391,12 @@ end( push_coroutine< R > & c)

}

-// forward declaration of Boost.Range traits to break dependency on it
-template<typename C, typename Enabler>
-struct range_mutable_iterator;
-
-template<typename C, typename Enabler>
-struct range_const_iterator;
-
template< typename Arg >
-struct range_mutable_iterator< coroutines::push_coroutine< Arg >, void >
+struct range_mutable_iterator< coroutines::push_coroutine< Arg > >
{ typedef typename coroutines::push_coroutine< Arg >::iterator type; };

template< typename R >
-struct range_mutable_iterator< coroutines::pull_coroutine< R >, void >
+struct range_mutable_iterator< coroutines::pull_coroutine< R > >
{ typedef typename coroutines::pull_coroutine< R >::iterator type; };

}
--
2.21.0

9 changes: 9 additions & 0 deletions recipes/boost/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ CONAN_BASIC_SETUP()

IF(NOT HEADER_ONLY)
set(boost_components)
if (WITH_COROUTINE)
list(APPEND boost_components coroutine)
list(APPEND boost_components thread)
endif()
if (WITH_PYTHON)
list(APPEND boost_components python)
endif()
Expand Down Expand Up @@ -48,6 +52,11 @@ IF(NOT HEADER_ONLY)
TARGET_LINK_LIBRARIES(test ${CONAN_LIBS})
endif()

if (WITH_COROUTINE)
ADD_EXECUTABLE(coroutine_exe coroutine.cpp)
TARGET_LINK_LIBRARIES(coroutine_exe ${Boost_LIBRARIES})
endif()

if (WITH_CHRONO)
ADD_EXECUTABLE(chrono_exe chrono.cpp)
TARGET_LINK_LIBRARIES(chrono_exe ${CONAN_LIBS})
Expand Down
2 changes: 2 additions & 0 deletions recipes/boost/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def build(self):
cmake.definitions["WITH_REGEX"] = "TRUE"
if not self.options["boost"].without_test:
cmake.definitions["WITH_TEST"] = "TRUE"
if not self.options["boost"].without_coroutine:
cmake.definitions["WITH_COROUTINE"] = "TRUE"
if not self.options["boost"].without_chrono:
cmake.definitions["WITH_CHRONO"] = "TRUE"
cmake.configure()
Expand Down
19 changes: 19 additions & 0 deletions recipes/boost/all/test_package/coroutine.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <boost/coroutine/all.hpp>
#include <iostream>

using namespace boost::coroutines;

void cooperative(coroutine<void>::push_type &sink)
{
std::cout << "Hello";
sink();
std::cout << "world";
}

int main()
{
coroutine<void>::pull_type source(cooperative);
std::cout << ", ";
source();
std::cout << "!\n";
}