Skip to content

Commit fbdace8

Browse files
hypcompnerd
authored andcommitted
[android] workaround for a serialization crash (#78)
Crash is tracked by: swiftlang/swift#74578
1 parent b756026 commit fbdace8

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ include_directories(SYSTEM ${_SWIFT_INCLUDE_DIR}/include)
2525

2626
add_library(firebase INTERFACE)
2727
target_compile_options(firebase INTERFACE
28-
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc -DSR69711>"
28+
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc -DSR69711 -Xcc -DSR74578>"
2929
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc -DINTERNAL_EXPERIMENTAL>")
3030
target_include_directories(firebase INTERFACE
3131
Sources/firebase/include

Sources/firebase/include/FirebaseCore.hh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ class SWIFT_CONFORMS_TO_PROTOCOL(FirebaseCore.FutureProtocol)
3535
completion(user_data);
3636
});
3737
}
38+
39+
// FIXME: Remove once https://github.com/apple/swift/issues/74578 is fixed.
40+
#if defined(SR74578)
41+
int error() const {
42+
return ::firebase::Future<R>::error();
43+
}
44+
45+
const R *result() const {
46+
return ::firebase::Future<R>::result();
47+
}
48+
49+
const char *error_message() const {
50+
return ::firebase::Future<R>::error_message();
51+
}
52+
#endif
3853
};
3954

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

0 commit comments

Comments
 (0)