Skip to content

Commit 1e1905c

Browse files
committed
Merge branch 'dm/windows' into 'master'
dm/windows See merge request Tanker/tconcurrent!3
2 parents 2e63b67 + fd3d7a1 commit 1e1905c

5 files changed

Lines changed: 43 additions & 13 deletions

File tree

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
image: tanker.local:5000/ci-cpp:latest
2+
13
before_script:
24
- dmenv install
35

CMakeLists.txt

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,30 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
1212

1313

1414
set(tconcurrent_SRC
15+
include/tconcurrent/async.hpp
16+
include/tconcurrent/async_wait.hpp
17+
include/tconcurrent/barrier.hpp
18+
include/tconcurrent/cancelation_token.hpp
19+
include/tconcurrent/concurrent_queue.hpp
20+
include/tconcurrent/coroutine.hpp
21+
include/tconcurrent/detail/boost_fwd.hpp
22+
include/tconcurrent/detail/export.hpp
23+
include/tconcurrent/detail/shared_base.hpp
24+
include/tconcurrent/detail/util.hpp
25+
include/tconcurrent/executor.hpp
26+
include/tconcurrent/future.hpp
27+
include/tconcurrent/future_group.hpp
28+
include/tconcurrent/job.hpp
29+
include/tconcurrent/packaged_task.hpp
30+
include/tconcurrent/periodic_task.hpp
31+
include/tconcurrent/promise.hpp
32+
include/tconcurrent/semaphore.hpp
33+
include/tconcurrent/stackful_coroutine.hpp
34+
include/tconcurrent/stackless_coroutine.hpp
35+
include/tconcurrent/stepper.hpp
36+
include/tconcurrent/task_auto_canceler.hpp
37+
include/tconcurrent/thread_pool.hpp
38+
include/tconcurrent/when.hpp
1539
src/barrier.cpp
1640
src/periodic_task.cpp
1741
src/stepper.cpp
@@ -30,19 +54,14 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
3054
src/executor_emscripten.cpp
3155
)
3256
else()
33-
find_package(Boost 1.61 REQUIRED COMPONENTS system thread context)
34-
3557
list(APPEND tconcurrent_SRC
3658
src/async_wait.cpp
3759
src/executor.cpp
3860
src/stackful_coroutine.cpp
3961
src/thread_pool.cpp
4062
)
4163
list(APPEND tconcurrent_LIBS
42-
# Keep components, to avoid linking with everything
43-
Boost::system
44-
Boost::thread
45-
Boost::context
64+
CONAN_PKG::Boost
4665
CONAN_PKG::enum-flags
4766
)
4867
endif()

conanfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
doctest/2.0.1@tanker/testing
33

44
[requires]
5-
Boost/1.66.0@tanker/testing
5+
Boost/1.68.0@tanker/testing
66
enum-flags/0.1a@tanker/testing
77

88
[generators]

include/tconcurrent/stackful_coroutine.hpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
#include <sanitizer/common_interface_defs.h>
2222
#endif
2323

24+
#if __cplusplus >= 201703L
25+
#define TCONCURRENT_NODISCARD [[nodiscard]]
26+
#elif defined(__GNUG__)
27+
#define TCONCURRENT_NODISCARD __attribute__((warn_unused_result))
28+
#else
29+
#define TCONCURRENT_NODISCARD
30+
#endif
31+
32+
2433
namespace tconcurrent
2534
{
2635
template <typename E, typename F>
@@ -297,7 +306,7 @@ struct cotask_value
297306
};
298307

299308
template <typename T>
300-
class [[nodiscard]] cotask_impl {
309+
class TCONCURRENT_NODISCARD cotask_impl {
301310
public:
302311
using value_type = T;
303312

@@ -321,7 +330,7 @@ class [[nodiscard]] cotask_impl {
321330
};
322331

323332
template <>
324-
class [[nodiscard]] cotask_impl<void> {
333+
class TCONCURRENT_NODISCARD cotask_impl<void> {
325334
public:
326335
using value_type = void;
327336

test/test_future.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,20 @@ TEST_CASE("future<void> should work")
6161

6262
TEST_CASE("exceptional future")
6363
{
64-
auto future = make_exceptional_future<int>("FAIL");
64+
auto future = make_exceptional_future<int>(std::invalid_argument{"kaboom"});
6565
CHECK(future.is_ready());
6666
CHECK(!future.has_value());
6767
CHECK(future.has_exception());
68-
CHECK_THROWS_AS(future.get(), char*);
68+
CHECK_THROWS_AS(future.get(), std::invalid_argument);
6969
}
7070

7171
TEST_CASE("exceptional future<void>")
7272
{
73-
auto future = make_exceptional_future<void>("FAIL");
73+
auto future = make_exceptional_future<void>(std::invalid_argument{"kaboom"});
7474
CHECK(future.is_ready());
7575
CHECK(!future.has_value());
7676
CHECK(future.has_exception());
77-
CHECK_THROWS_AS(future.get(), char*);
77+
CHECK_THROWS_AS(future.get(), std::invalid_argument);
7878
}
7979

8080
TEST_CASE("future.wait_for should timeout properly [waiting]")

0 commit comments

Comments
 (0)