Conversation
|
Looks like this causes problem with wasm: (same error for all wasm builds)
Maybe we need to enable them somehow? |
|
Added a commit that will solve the wasm failure and #8449 |
c90f975 to
781cb17
Compare
tronical
left a comment
There was a problem hiding this comment.
The remove_extern macro is a nice solution :)
| quote!(#doc).into() | ||
| } | ||
|
|
||
| /// Attribute macro that removes `extern "..."` from the functon sugnatures |
There was a problem hiding this comment.
| /// Attribute macro that removes `extern "..."` from the functon sugnatures | |
| /// Attribute macro that removes `extern "..."` from the functon signatures |
|
|
||
| /// Attribute macro that removes `extern "..."` from the functon sugnatures | ||
| /// | ||
| /// This is usefull because wasm does not support `extern "C-unwind"` and also |
There was a problem hiding this comment.
| /// This is usefull because wasm does not support `extern "C-unwind"` and also | |
| /// This is useful because wasm does not support `extern "C-unwind"` and also |
| #[allow(missing_docs)] | ||
| #[vtable::vtable] | ||
| #[cfg_attr(not(feature = "ffi"), i_slint_core_macros::remove_extern)] | ||
| #[vtable::vtable(no_extern)] |
There was a problem hiding this comment.
Since this is used unconditionally and all fn fields have an ABI, perhaps it would be a better API if it was called require_abi and error out if a fn has no ABI?
There was a problem hiding this comment.
This would be a breaking change in the vtable crate.
I could release vtable 0.3 for it though.
There was a problem hiding this comment.
Why is it breaking if the proposed behaviour applies only when using the new #[vtable(require_abi)] attribute?
There was a problem hiding this comment.
The previous #[vtable] macro was always adding the extern "C"
There was a problem hiding this comment.
Ahh yes, indeed, that would make it a little awkward. Ok, never mind - I'm just (unintentionally) nitpicking :)
a07a162 to
4efc132
Compare
|
Updated to have a new major release of vtable that no longer change the |
When using rust, allow panics to cross the boundaries of our vtable traits. This avoids panic producing two backtrace with panic=unwind This patch doesn't touch the ABI of out FFI interface, they stay extern "C", because if a panic or exception crosses these boundaries, we are in trouble. (Also, we have a panic=abort in our Cargo.toml anyway)
In fact, remove it for non-C++ Because wasm doesn't support C-unwind. And actually warns about incompatible ABI for the rest Fixes #8449
When using rust, allow panics to cross the boundaries of our vtable traits. This avoids panic producing two backtrace with panic=unwind
This patch doesn't touch the ABI of out FFI interface, they stay extern "C", because if a panic or exception crosses these boundaries, we are in trouble. (Also, we have a panic=abort in our Cargo.toml anyway)