Skip to content

Adding versioning macros to the C API? #5635

@thibaultcha

Description

@thibaultcha

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    wasmtime:c-apiIssues pertaining to the C API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions