1121: Add test for ImportObject's `allow_missing_functions` r=Hywan a=MarkMcCaskey
work in progress, testing to see if this test fails CI
resolves#1118
# Review
- [ ] Add a short description of the the change to the CHANGELOG.md file
Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
1128: fix(runtime-core) Avoid crashing when missing host functions are allowed r=Hywan a=Hywan
Fix#1118. #1121 can be merged after
This PR fixes 2 things:
* When droping the import backing, check that `vm::FuncCtx` isn't null before dropping it,
* Use an `always_trap` as a placeholder host function when a host function is missing.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
1130: Add WindowClosed event to experimental fb r=MarkMcCaskey a=MarkMcCaskey
Allows things to behave properly and know when the window closes
Co-authored-by: Mark McCaskey <mark@wasmer.io>
1123: feat(runtime-c-api) Define the `DEPRECATED` C macro. r=Hywan a=Hywan
This PR defines a cross-compiler `DEPRECATED(message)` macro. It must
be used as follows in Rust:
```rust
/// This is a documentation.
/// cbindgen:prefix=DEPRECATED("This is a deprecation message.")
pub extern "C" fn wasmer_foo() -> c_uint {
42
}
```
It will generate the following C header:
```c
/**
* This is a documentation.
*/
DEPRECATED("This is a deprecation message.")
unsigned int wasmer_foo();
```
And once this code is used by a C compiler, it will print something
like this (example from Clang):
```
…/test.c:…:…: error: 'wasmer_foo' is deprecated: This is a deprecation message. [-Werror,-Wdeprecated-declarations]
unsigned int x = wasmer_foo();
^
…/wasmer.h:…:…: note: 'wasmer_foo' has been explicitly marked deprecated here
DEPRECATED("This is a deprecation message.")
^
…/wasmer.h:…:…: note: expanded from macro 'DEPRECATED'
```
This is required for further deprecations.
(cf https://github.com/eqrion/cbindgen/issues/408)
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
Clang can emulate GNUC or MSVC behaviors. So instead of detecting
whether Clang is used to compile the code, it's better to detect the
targeted features are available.
Code proposed by @nlewycky, thanks!
1124: Update wapm submodule to 0.4.2 r=MarkMcCaskey a=MarkMcCaskey
Uses the updated wapm from the new release https://github.com/wasmerio/wapm-cli/releases/tag/0.4.2 which fixes a bug
Co-authored-by: Mark McCaskey <mark@wasmer.io>
This PR defines a cross-compiler `DEPRECATED(message)` macro. It must
be used as follows in Rust:
```rust
/// This is a documentation.
/// cbindgen:prefix=DEPRECATED(This is a deprecation message.")
pub extern "C" fn wasmer_foo() -> c_uint {
42
}
```
It will generate the following C header:
```c
/**
* This is a documentation.
*/
DEPRECATED("This is a deprecation message.")
unsigned int wasmer_foo();
```
And once this code is used by a C compiler, it will print something
like this (example from Clang):
```
…/test.c:…:…: error: 'wasmer_foo' is deprecated: This is a deprecation message. [-Werror,-Wdeprecated-declarations]
unsigned int x = wasmer_foo();
^
…/wasmer.h:…:…: note: 'wasmer_foo' has been explicitly marked deprecated here
DEPRECATED("This is a deprecation message.")
^
…/wasmer.h:…:…: note: expanded from macro 'DEPRECATED'
```
This is required for further deprecations.