Skip to content

Commit

Permalink
Bump Wasmer & Wasmtime versions
Browse files Browse the repository at this point in the history
Closes #73
  • Loading branch information
ashtonmeuser committed Oct 11, 2024
1 parent 3ba8bdc commit 118ecdb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ Useful for minimizing changes to implementation files between targets e.g. GDExt
#define TIME_MONOTONIC Time::get_singleton()->get_ticks_usec() * 1000
#define NULL_VARIANT Variant()
#define PAGE_SIZE 65536
#define GODOT_WASM_EXTERNREF 128 // Different enums in Wasmer & Wasmtime (see https://github.com/wasmerio/wasmer/issues/5082)

#endif
8 changes: 4 additions & 4 deletions src/wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace godot {
inline wasm_val_t error_value(const char* message) {
PRINT_ERROR(message);
wasm_val_t value;
value.kind = GODOT_WASM_EXTERNREF;
value.kind = WASM_EXTERNREF;
value.of.ref = NULL;
return value;
}
Expand Down Expand Up @@ -121,12 +121,12 @@ namespace godot {
if ((size_t)array.size() != results->size) return ERR_PARAMETER_RANGE_ERROR;
for (uint16_t i = 0; i < results->size; i++) {
results->data[i] = encode_variant(array[i], context->results[i]);
if (results->data[i].kind == GODOT_WASM_EXTERNREF) return ERR_INVALID_DATA;
if (results->data[i].kind == WASM_EXTERNREF) return ERR_INVALID_DATA;
}
return OK;
} else if (results->size == 1) {
results->data[0] = encode_variant(variant, context->results[0]);
return results->data[0].kind == GODOT_WASM_EXTERNREF ? ERR_INVALID_DATA : OK;
return results->data[0].kind == WASM_EXTERNREF ? ERR_INVALID_DATA : OK;
} else return ERR_INVALID_DATA;
}

Expand Down Expand Up @@ -449,7 +449,7 @@ namespace godot {
for (uint16_t i = 0; i < args.size(); i++) {
Variant variant = args[i];
wasm_val_t value = encode_variant(variant, context.params[i]);
FAIL_IF(value.kind == GODOT_WASM_EXTERNREF, "Invalid argument type", NULL_VARIANT);
FAIL_IF(value.kind == WASM_EXTERNREF, "Invalid argument type", NULL_VARIANT);
args_vec.push_back(value);
}
wasm_val_vec_t f_args = { args_vec.size(), args_vec.data() };
Expand Down
4 changes: 2 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from zipfile import ZipFile

WASMER_BASE_URL = "https://github.com/wasmerio/wasmer/releases/download/{0}/wasmer-{1}.tar.gz"
WASMER_VER_DEFAULT = "v4.3.7"
WASMER_VER_DEFAULT = "v4.4.0"
WASMTIME_BASE_URL = "https://github.com/bytecodealliance/wasmtime/releases/download/{0}/wasmtime-{0}-{1}-c-api.{2}"
WASMTIME_VER_DEFAULT = "v24.0.0"
WASMTIME_VER_DEFAULT = "v25.0.2"


def _validate_version(v):
Expand Down

0 comments on commit 118ecdb

Please sign in to comment.