diff --git a/src/defs.h b/src/defs.h index b2e9feb..c9ddbc6 100644 --- a/src/defs.h +++ b/src/defs.h @@ -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 diff --git a/src/wasm.cpp b/src/wasm.cpp index 221cfaf..616f43d 100644 --- a/src/wasm.cpp +++ b/src/wasm.cpp @@ -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; } @@ -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; } @@ -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() }; diff --git a/utils.py b/utils.py index 23c967d..e2957ed 100644 --- a/utils.py +++ b/utils.py @@ -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):