thibaultcha edited issue #5635:
Feature
Could we add versioning macros to the C API in
wasmtime.h
?Benefit
As our embedder program can be linked against several Wasm runtimes, we wish to add compilation guards ensuring the version of these runtimes is either tested or compatible with the targets chosen by our users; without them having to face numerous compilation errors or more obscure behavior when it is not the case.
E.g.
#if WASMTIME_VERSION_MAJOR != 5 #error Unsupported Wasmtime version detected, please use Wasmtime 5.x.y #endif
Implementation
E.g.
// wasmtime.h #define WASMTIME_VERSION "5.0.0" #define WASMTIME_VERSION_MAJOR 5 #define WASMTIME_VERSION_MINOR 0 #define WASMTIME_VERSION_PATCH 0
Alternatives
N/A
alexcrichton labeled issue #5635:
Feature
Could we add versioning macros to the C API in
wasmtime.h
?Benefit
As our embedder program can be linked against several Wasm runtimes, we wish to add compilation guards ensuring the version of these runtimes is either tested or compatible with the targets chosen by our users; without them having to face numerous compilation errors or more obscure behavior when it is not the case.
E.g.
#if WASMTIME_VERSION_MAJOR != 5 #error Unsupported Wasmtime version detected, please use Wasmtime 5.x.y #endif
Implementation
E.g.
// wasmtime.h #define WASMTIME_VERSION "5.0.0" #define WASMTIME_VERSION_MAJOR 5 #define WASMTIME_VERSION_MINOR 0 #define WASMTIME_VERSION_PATCH 0
Alternatives
N/A
alexcrichton commented on issue #5635:
Seems reasonable to me to add!
One thing to watch out for though is that we'll want support in https://github.com/bytecodealliance/wasmtime/blob/main/scripts/publish.rs to have that script update these version numbers along with other version numbers.
alexcrichton closed issue #5635:
Feature
Could we add versioning macros to the C API in
wasmtime.h
?Benefit
As our embedder program can be linked against several Wasm runtimes, we wish to add compilation guards ensuring the version of these runtimes is either tested or compatible with the targets chosen by our users; without them having to face numerous compilation errors or more obscure behavior when it is not the case.
E.g.
#if WASMTIME_VERSION_MAJOR != 5 #error Unsupported Wasmtime version detected, please use Wasmtime 5.x.y #endif
Implementation
E.g.
// wasmtime.h #define WASMTIME_VERSION "5.0.0" #define WASMTIME_VERSION_MAJOR 5 #define WASMTIME_VERSION_MINOR 0 #define WASMTIME_VERSION_PATCH 0
Alternatives
N/A
Last updated: Dec 23 2024 at 13:07 UTC