Skip to content

Commit

Permalink
feat(c-api) Add the WASMER_VERSION_{MAJOR|MINOR|PATCH|PRE} constant…
Browse files Browse the repository at this point in the history
…s in C.
  • Loading branch information
Hywan committed Dec 11, 2020
1 parent fdeb4a6 commit 36581cf
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/c-api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,17 @@ fn add_wasmer_version(pre_header: &mut String) {
pre_header.push_str(&format!(
r#"
// This file corresponds to the following Wasmer version.
#define WASMER_VERSION "{version}"
#define WASMER_VERSION "{full}"
#define WASMER_VERSION_MAJOR "{major}"
#define WASMER_VERSION_MINOR "{minor}"
#define WASMER_VERSION_PATCH "{patch}"
#define WASMER_VERSION_PRE "{pre}"
"#,
version = env!("CARGO_PKG_VERSION")
full = env!("CARGO_PKG_VERSION"),
major = env!("CARGO_PKG_VERSION_MAJOR"),
minor = env!("CARGO_PKG_VERSION_MINOR"),
patch = env!("CARGO_PKG_VERSION_PATCH"),
pre = env!("CARGO_PKG_VERSION_PRE"),
));
}

Expand Down
4 changes: 4 additions & 0 deletions lib/c-api/wasmer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

// This file corresponds to the following Wasmer version.
#define WASMER_VERSION "1.0.0-beta1"
#define WASMER_VERSION_MAJOR "1"
#define WASMER_VERSION_MINOR "0"
#define WASMER_VERSION_PATCH "0"
#define WASMER_VERSION_PRE "beta1"

#endif // WASMER_H_PRELUDE

Expand Down
4 changes: 4 additions & 0 deletions lib/c-api/wasmer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

// This file corresponds to the following Wasmer version.
#define WASMER_VERSION "1.0.0-beta1"
#define WASMER_VERSION_MAJOR "1"
#define WASMER_VERSION_MINOR "0"
#define WASMER_VERSION_PATCH "0"
#define WASMER_VERSION_PRE "beta1"

#endif // WASMER_H_PRELUDE

Expand Down
4 changes: 4 additions & 0 deletions lib/c-api/wasmer_wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@

// This file corresponds to the following Wasmer version.
#define WASMER_VERSION "1.0.0-beta1"
#define WASMER_VERSION_MAJOR "1"
#define WASMER_VERSION_MINOR "0"
#define WASMER_VERSION_PATCH "0"
#define WASMER_VERSION_PRE "beta1"

#endif // WASMER_WASM_H_PRELUDE

Expand Down

0 comments on commit 36581cf

Please sign in to comment.