Skip to content

Commit

Permalink
Fix compilation for djinni::Future
Browse files Browse the repository at this point in the history
  • Loading branch information
jb-gcx committed May 8, 2024
1 parent ecffe7e commit 3f40e5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion support-lib/cpp/Future.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <condition_variable>
#include <mutex>
#include <cassert>
#include <exception>

#ifdef __cpp_coroutines
#if __has_include(<coroutine>)
Expand Down Expand Up @@ -414,7 +415,7 @@ Future<void> combine(U&& futures, size_t c) {
return future;
}
for (auto& f: futures) {
f.then([context] (auto f) {
f.then([context] (auto) {
if (--(context->counter) == 0) {
context->promise.setValue();
}
Expand Down
4 changes: 2 additions & 2 deletions support-lib/objc/Future_objc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class FutureAdaptor<Void>

__block auto p = std::make_unique<NativePromiseType>();
auto f = p->getFuture();
[o then: ^id(DJFuture* res) {
[o then: ^id(DJFuture*) {
@try {
p->setValue();
} @catch (NSException* e) {
Expand All @@ -98,7 +98,7 @@ class FutureAdaptor<Void>
DJPromise<NSNull*>* promise = [[DJPromise alloc] init];
DJFuture<NSNull*>* future = [promise getFuture];

c.then([promise] (Future<void> res) {
c.then([promise] (Future<void>) {
try {
[promise setValue:[NSNull null]];
} catch (const std::exception& e) {
Expand Down

0 comments on commit 3f40e5a

Please sign in to comment.