Add apis to get package version (#3601)

Add three APIs:
- wasm_runtime_get_file_package_version
- wasm_runtime_get_module_package_version
- wasm_runtime_get_current_package_version
This commit is contained in:
Benbuck Nason
2024-07-15 17:15:59 -07:00
committed by GitHub
parent 7affac0ed3
commit 501d7d5adf
6 changed files with 102 additions and 5 deletions

View File

@ -4168,6 +4168,8 @@ load(const uint8 *buf, uint32 size, AOTModule *module,
return false;
}
module->package_version = version;
if (!create_sections(module, buf, size, &section_list, error_buf,
error_buf_size))
return false;

View File

@ -130,6 +130,9 @@ typedef struct LocalRefFlag {
typedef struct AOTModule {
uint32 module_type;
/* the package version read from the AOT file */
uint32 package_version;
/* import memories */
uint32 import_memory_count;
AOTImportMemory *import_memories;