File tree 3 files changed +18
-5
lines changed
3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 9
9
10
10
### Added
11
11
12
+ - [ #1736 ] ( https://github.com/wasmerio/wasmer/pull/1736 ) Implement ` wasm_global_type ` in the Wasm C API.
12
13
- [ #1699 ] ( https://github.com/wasmerio/wasmer/pull/1699 ) Update ` wasm.h ` to its latest version.
13
14
- [ #1685 ] ( https://github.com/wasmerio/wasmer/pull/1685 ) Implement ` wasm_exporttype_delete ` in the Wasm C API.
14
15
- [ #1725 ] ( https://github.com/wasmerio/wasmer/pull/1725 ) Implement ` wasm_func_type ` in the Wasm C API.
Original file line number Diff line number Diff line change @@ -59,3 +59,8 @@ pub unsafe extern "C" fn wasm_global_same(
59
59
) -> bool {
60
60
wasm_global1. inner . same ( & wasm_global2. inner )
61
61
}
62
+
63
+ #[ no_mangle]
64
+ pub extern "C" fn wasm_global_type ( wasm_global : & wasm_global_t ) -> Box < wasm_globaltype_t > {
65
+ Box :: new ( wasm_globaltype_t:: new ( wasm_global. inner . ty ( ) . clone ( ) ) )
66
+ }
Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ impl wasm_globaltype_t {
20
20
) ;
21
21
}
22
22
}
23
+
24
+ pub ( crate ) fn new ( global_type : GlobalType ) -> Self {
25
+ Self {
26
+ extern_ : wasm_externtype_t {
27
+ inner : ExternType :: Global ( global_type) ,
28
+ } ,
29
+ }
30
+ }
23
31
}
24
32
25
33
wasm_declare_vec ! ( globaltype) ;
@@ -42,11 +50,10 @@ unsafe fn wasm_globaltype_new_inner(
42
50
mutability : wasm_mutability_t ,
43
51
) -> Option < Box < wasm_globaltype_t > > {
44
52
let me: wasm_mutability_enum = mutability. try_into ( ) . ok ( ) ?;
45
- let gd = Box :: new ( wasm_globaltype_t {
46
- extern_ : wasm_externtype_t {
47
- inner : ExternType :: Global ( GlobalType :: new ( ( * valtype) . into ( ) , me. into ( ) ) ) ,
48
- } ,
49
- } ) ;
53
+ let gd = Box :: new ( wasm_globaltype_t:: new ( GlobalType :: new (
54
+ ( * valtype) . into ( ) ,
55
+ me. into ( ) ,
56
+ ) ) ) ;
50
57
wasm_valtype_delete ( Some ( valtype) ) ;
51
58
52
59
Some ( gd)
You can’t perform that action at this time.
0 commit comments