File tree Expand file tree Collapse file tree 9 files changed +28
-52
lines changed Expand file tree Collapse file tree 9 files changed +28
-52
lines changed Original file line number Diff line number Diff line change @@ -417,7 +417,7 @@ impl Type {
417
417
}
418
418
syn:: Type :: BareFn ( ref function) => {
419
419
let mut wildcard_counter = 0 ;
420
- let args = function. inputs . iter ( ) . try_skip_map ( |x| {
420
+ let mut args = function. inputs . iter ( ) . try_skip_map ( |x| {
421
421
Type :: load ( & x. ty ) . map ( |opt_ty| {
422
422
opt_ty. map ( |ty| {
423
423
(
@@ -438,6 +438,9 @@ impl Type {
438
438
} )
439
439
} )
440
440
} ) ?;
441
+ if function. variadic . is_some ( ) {
442
+ args. push ( ( None , Type :: Primitive ( super :: PrimitiveType :: VaList ) ) )
443
+ }
441
444
let ( ret, never_return) = Type :: load_from_output ( & function. output ) ?;
442
445
Type :: FuncPtr {
443
446
ret : Box :: new ( ret) ,
Original file line number Diff line number Diff line change 5
5
6
6
typedef int32_t (* VaListFnPtr )(int32_t count , ...);
7
7
8
- typedef int32_t (* VaListFnPtr2 )(int32_t count );
8
+ typedef int32_t (* VaListFnPtr2 )(int32_t count , ... );
9
9
10
10
typedef struct {
11
11
int32_t (* fn1 )(int32_t count , ...);
12
12
} Interface_______i32_______i32_______va_list ;
13
13
14
- typedef struct {
15
- int32_t (* fn1 )(int32_t count );
16
- } Interface_______i32_______i32 ;
17
-
18
14
int32_t va_list_test (int32_t count , ...);
19
15
20
16
int32_t va_list_test2 (int32_t count , ...);
21
17
22
18
void va_list_fn_ptrs (int32_t (* fn1 )(int32_t count , ...),
23
- int32_t (* fn2 )(int32_t count ),
19
+ int32_t (* fn2 )(int32_t count , ... ),
24
20
VaListFnPtr fn3 ,
25
21
VaListFnPtr2 fn4 ,
26
22
Interface_______i32_______i32_______va_list fn5 ,
27
- Interface_______i32_______i32 fn6 );
23
+ Interface_______i32_______i32_______va_list fn6 );
Original file line number Diff line number Diff line change 5
5
6
6
typedef int32_t (* VaListFnPtr )(int32_t count , ...);
7
7
8
- typedef int32_t (* VaListFnPtr2 )(int32_t count );
8
+ typedef int32_t (* VaListFnPtr2 )(int32_t count , ... );
9
9
10
10
typedef struct {
11
11
int32_t (* fn1 )(int32_t count , ...);
12
12
} Interface_______i32_______i32_______va_list ;
13
13
14
- typedef struct {
15
- int32_t (* fn1 )(int32_t count );
16
- } Interface_______i32_______i32 ;
17
-
18
14
#ifdef __cplusplus
19
15
extern "C" {
20
16
#endif // __cplusplus
@@ -24,11 +20,11 @@ int32_t va_list_test(int32_t count, ...);
24
20
int32_t va_list_test2 (int32_t count , ...);
25
21
26
22
void va_list_fn_ptrs (int32_t (* fn1 )(int32_t count , ...),
27
- int32_t (* fn2 )(int32_t count ),
23
+ int32_t (* fn2 )(int32_t count , ... ),
28
24
VaListFnPtr fn3 ,
29
25
VaListFnPtr2 fn4 ,
30
26
Interface_______i32_______i32_______va_list fn5 ,
31
- Interface_______i32_______i32 fn6 );
27
+ Interface_______i32_______i32_______va_list fn6 );
32
28
33
29
#ifdef __cplusplus
34
30
} // extern "C"
Original file line number Diff line number Diff line change 6
6
7
7
using VaListFnPtr = int32_t (*)(int32_t count, ...);
8
8
9
- using VaListFnPtr2 = int32_t (*)(int32_t count);
9
+ using VaListFnPtr2 = int32_t (*)(int32_t count, ... );
10
10
11
11
template <typename T>
12
12
struct Interface {
@@ -20,10 +20,10 @@ int32_t va_list_test(int32_t count, ...);
20
20
int32_t va_list_test2 (int32_t count, ...);
21
21
22
22
void va_list_fn_ptrs (int32_t (*fn1)(int32_t count, ...),
23
- int32_t (*fn2)(int32_t count),
23
+ int32_t (*fn2)(int32_t count, ... ),
24
24
VaListFnPtr fn3,
25
25
VaListFnPtr2 fn4,
26
26
Interface<int32_t(*)(int32_t count, ...)> fn5,
27
- Interface<int32_t(*)(int32_t count)> fn6);
27
+ Interface<int32_t(*)(int32_t count, ... )> fn6);
28
28
29
29
} // extern "C"
Original file line number Diff line number Diff line change @@ -8,21 +8,18 @@ cdef extern from *:
8
8
9
9
ctypedef int32_t (* VaListFnPtr)(int32_t count, ...);
10
10
11
- ctypedef int32_t (* VaListFnPtr2)(int32_t count);
11
+ ctypedef int32_t (* VaListFnPtr2)(int32_t count, ... );
12
12
13
13
ctypedef struct Interface_______i32_______i32_______va_list:
14
14
int32_t (* fn1)(int32_t count, ...);
15
15
16
- ctypedef struct Interface_______i32_______i32:
17
- int32_t (* fn1)(int32_t count);
18
-
19
16
int32_t va_list_test(int32_t count, ...);
20
17
21
18
int32_t va_list_test2(int32_t count, ...);
22
19
23
20
void va_list_fn_ptrs(int32_t (* fn1)(int32_t count, ...),
24
- int32_t (* fn2)(int32_t count),
21
+ int32_t (* fn2)(int32_t count, ... ),
25
22
VaListFnPtr fn3,
26
23
VaListFnPtr2 fn4,
27
24
Interface_______i32_______i32_______va_list fn5,
28
- Interface_______i32_______i32 fn6);
25
+ Interface_______i32_______i32_______va_list fn6);
Original file line number Diff line number Diff line change 5
5
6
6
typedef int32_t (* VaListFnPtr )(int32_t count , ...);
7
7
8
- typedef int32_t (* VaListFnPtr2 )(int32_t count );
8
+ typedef int32_t (* VaListFnPtr2 )(int32_t count , ... );
9
9
10
10
typedef struct Interface_______i32_______i32_______va_list {
11
11
int32_t (* fn1 )(int32_t count , ...);
12
12
} Interface_______i32_______i32_______va_list ;
13
13
14
- typedef struct Interface_______i32_______i32 {
15
- int32_t (* fn1 )(int32_t count );
16
- } Interface_______i32_______i32 ;
17
-
18
14
int32_t va_list_test (int32_t count , ...);
19
15
20
16
int32_t va_list_test2 (int32_t count , ...);
21
17
22
18
void va_list_fn_ptrs (int32_t (* fn1 )(int32_t count , ...),
23
- int32_t (* fn2 )(int32_t count ),
19
+ int32_t (* fn2 )(int32_t count , ... ),
24
20
VaListFnPtr fn3 ,
25
21
VaListFnPtr2 fn4 ,
26
22
struct Interface_______i32_______i32_______va_list fn5 ,
27
- struct Interface_______i32_______i32 fn6 );
23
+ struct Interface_______i32_______i32_______va_list fn6 );
Original file line number Diff line number Diff line change 5
5
6
6
typedef int32_t (* VaListFnPtr )(int32_t count , ...);
7
7
8
- typedef int32_t (* VaListFnPtr2 )(int32_t count );
8
+ typedef int32_t (* VaListFnPtr2 )(int32_t count , ... );
9
9
10
10
typedef struct Interface_______i32_______i32_______va_list {
11
11
int32_t (* fn1 )(int32_t count , ...);
12
12
} Interface_______i32_______i32_______va_list ;
13
13
14
- typedef struct Interface_______i32_______i32 {
15
- int32_t (* fn1 )(int32_t count );
16
- } Interface_______i32_______i32 ;
17
-
18
14
#ifdef __cplusplus
19
15
extern "C" {
20
16
#endif // __cplusplus
@@ -24,11 +20,11 @@ int32_t va_list_test(int32_t count, ...);
24
20
int32_t va_list_test2 (int32_t count , ...);
25
21
26
22
void va_list_fn_ptrs (int32_t (* fn1 )(int32_t count , ...),
27
- int32_t (* fn2 )(int32_t count ),
23
+ int32_t (* fn2 )(int32_t count , ... ),
28
24
VaListFnPtr fn3 ,
29
25
VaListFnPtr2 fn4 ,
30
26
struct Interface_______i32_______i32_______va_list fn5 ,
31
- struct Interface_______i32_______i32 fn6 );
27
+ struct Interface_______i32_______i32_______va_list fn6 );
32
28
33
29
#ifdef __cplusplus
34
30
} // extern "C"
Original file line number Diff line number Diff line change 5
5
6
6
typedef int32_t (* VaListFnPtr )(int32_t count , ...);
7
7
8
- typedef int32_t (* VaListFnPtr2 )(int32_t count );
8
+ typedef int32_t (* VaListFnPtr2 )(int32_t count , ... );
9
9
10
10
struct Interface_______i32_______i32_______va_list {
11
11
int32_t (* fn1 )(int32_t count , ...);
12
12
};
13
13
14
- struct Interface_______i32_______i32 {
15
- int32_t (* fn1 )(int32_t count );
16
- };
17
-
18
14
int32_t va_list_test (int32_t count , ...);
19
15
20
16
int32_t va_list_test2 (int32_t count , ...);
21
17
22
18
void va_list_fn_ptrs (int32_t (* fn1 )(int32_t count , ...),
23
- int32_t (* fn2 )(int32_t count ),
19
+ int32_t (* fn2 )(int32_t count , ... ),
24
20
VaListFnPtr fn3 ,
25
21
VaListFnPtr2 fn4 ,
26
22
struct Interface_______i32_______i32_______va_list fn5 ,
27
- struct Interface_______i32_______i32 fn6 );
23
+ struct Interface_______i32_______i32_______va_list fn6 );
Original file line number Diff line number Diff line change 5
5
6
6
typedef int32_t (* VaListFnPtr )(int32_t count , ...);
7
7
8
- typedef int32_t (* VaListFnPtr2 )(int32_t count );
8
+ typedef int32_t (* VaListFnPtr2 )(int32_t count , ... );
9
9
10
10
struct Interface_______i32_______i32_______va_list {
11
11
int32_t (* fn1 )(int32_t count , ...);
12
12
};
13
13
14
- struct Interface_______i32_______i32 {
15
- int32_t (* fn1 )(int32_t count );
16
- };
17
-
18
14
#ifdef __cplusplus
19
15
extern "C" {
20
16
#endif // __cplusplus
@@ -24,11 +20,11 @@ int32_t va_list_test(int32_t count, ...);
24
20
int32_t va_list_test2 (int32_t count , ...);
25
21
26
22
void va_list_fn_ptrs (int32_t (* fn1 )(int32_t count , ...),
27
- int32_t (* fn2 )(int32_t count ),
23
+ int32_t (* fn2 )(int32_t count , ... ),
28
24
VaListFnPtr fn3 ,
29
25
VaListFnPtr2 fn4 ,
30
26
struct Interface_______i32_______i32_______va_list fn5 ,
31
- struct Interface_______i32_______i32 fn6 );
27
+ struct Interface_______i32_______i32_______va_list fn6 );
32
28
33
29
#ifdef __cplusplus
34
30
} // extern "C"
You can’t perform that action at this time.
0 commit comments