@@ -30,17 +30,29 @@ mod host {
30
30
}
31
31
32
32
pub mod num {
33
- use crate :: types:: { number:: Type , JSNumber , Null , Number } ;
33
+ use crate :: types:: { ffi:: CTuple , number:: Type , JSNumber , Null , Number } ;
34
+ use core:: ffi:: c_void;
34
35
pub type Setter = extern "C" fn ( Number , JSNumber ) ;
35
36
pub type Getter = extern "C" fn ( Number ) -> JSNumber ;
36
37
37
38
#[ link( wasm_import_module = "nusa" ) ]
38
39
#[ allow( improper_ctypes) ]
39
40
extern "C" {
41
+ #[ cfg( target_feature = "multivalue" ) ]
40
42
#[ link_name = "num.allocate" ]
41
43
pub fn allocate ( ty : Type , len : u16 , nullable : bool ) -> ( Number , Null ) ;
44
+
45
+ #[ cfg( not( target_feature = "multivalue" ) ) ]
46
+ #[ link_name = "num.cABIallocate" ]
47
+ pub fn allocate ( ty : Type , len : u16 , nullable : bool ) -> CTuple < Number , Null > ;
48
+
49
+ #[ cfg( target_feature = "multivalue" ) ]
42
50
#[ link_name = "num.accessor" ]
43
51
pub fn accessor ( ty : Type ) -> ( Getter , Setter ) ;
52
+
53
+ #[ cfg( not( target_feature = "multivalue" ) ) ]
54
+ #[ link_name = "num.cABIaccessor" ]
55
+ pub fn accessor ( ty : Type ) -> CTuple < * const c_void , * const c_void > ;
44
56
}
45
57
46
58
#[ link( wasm_import_module = "nusa" ) ]
0 commit comments