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

[android] workaround for a serialization crash #78

Merged
merged 1 commit into from
Jun 20, 2024
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: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ include_directories(SYSTEM ${_SWIFT_INCLUDE_DIR}/include)

add_library(firebase INTERFACE)
target_compile_options(firebase INTERFACE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc -DSR69711>"
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc -DSR69711 -Xcc -DSR74578>"
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc -DINTERNAL_EXPERIMENTAL>")
target_include_directories(firebase INTERFACE
Sources/firebase/include
Expand Down
15 changes: 15 additions & 0 deletions Sources/firebase/include/FirebaseCore.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ class SWIFT_CONFORMS_TO_PROTOCOL(FirebaseCore.FutureProtocol)
completion(user_data);
});
}

// FIXME: Remove once https://github.com/apple/swift/issues/74578 is fixed.
#if defined(SR74578)
int error() const {
hyp marked this conversation as resolved.
Show resolved Hide resolved
return ::firebase::Future<R>::error();
}

const R *result() const {
return ::firebase::Future<R>::result();
}

const char *error_message() const {
return ::firebase::Future<R>::error_message();
}
#endif
};

// As a workaround, use `int` here instead of `void` for futures with no
Expand Down
Loading