File tree 4 files changed +47
-3
lines changed
4 files changed +47
-3
lines changed Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ fn args_from_ty_and_cursor(
311
311
cursor : & clang:: Cursor ,
312
312
ctx : & mut BindgenContext ,
313
313
) -> Vec < ( Option < String > , TypeId ) > {
314
- let cursor_args = cursor. args ( ) . unwrap ( ) . into_iter ( ) ;
314
+ let cursor_args = cursor. args ( ) . unwrap_or_default ( ) . into_iter ( ) ;
315
315
let type_args = ty. args ( ) . unwrap_or_default ( ) . into_iter ( ) ;
316
316
317
317
// Argument types can be found in either the cursor or the type, but argument names may only be
@@ -421,7 +421,16 @@ impl FunctionSig {
421
421
}
422
422
CXChildVisit_Continue
423
423
} ) ;
424
- args
424
+
425
+ if args. is_empty ( ) {
426
+ // FIXME(emilio): Sometimes libclang doesn't expose the
427
+ // right AST for functions tagged as stdcall and such...
428
+ //
429
+ // https://bugs.llvm.org/show_bug.cgi?id=45919
430
+ args_from_ty_and_cursor ( & ty, & cursor, ctx)
431
+ } else {
432
+ args
433
+ }
425
434
}
426
435
} ;
427
436
Original file line number Diff line number Diff line change
1
+ /* automatically generated by rust-bindgen */
2
+
3
+ #![ allow(
4
+ dead_code,
5
+ non_snake_case,
6
+ non_camel_case_types,
7
+ non_upper_case_globals
8
+ ) ]
9
+
10
+ pub type PFN_VIGEM_X360_NOTIFICATION = :: std:: option:: Option <
11
+ unsafe extern "C" fn (
12
+ arg1 : * mut :: std:: os:: raw:: c_void ,
13
+ arg2 : * mut :: std:: os:: raw:: c_void ,
14
+ arg3 : :: std:: os:: raw:: c_uchar ,
15
+ arg4 : :: std:: os:: raw:: c_uchar ,
16
+ arg5 : :: std:: os:: raw:: c_uchar ,
17
+ arg6 : * mut :: std:: os:: raw:: c_void ,
18
+ ) ,
19
+ > ;
Original file line number Diff line number Diff line change @@ -46,7 +46,11 @@ pub trait IFoo: Sized + std::ops::Deref {
46
46
unsafe fn setFunc_ (
47
47
self ,
48
48
func : :: std:: option:: Option <
49
- unsafe extern "C" fn ( ) -> :: std:: os:: raw:: c_int ,
49
+ unsafe extern "C" fn (
50
+ arg1 : :: std:: os:: raw:: c_char ,
51
+ arg2 : :: std:: os:: raw:: c_short ,
52
+ arg3 : f32 ,
53
+ ) -> :: std:: os:: raw:: c_int ,
50
54
> ,
51
55
) where
52
56
<Self as std:: ops:: Deref >:: Target : objc:: Message + Sized ,
Original file line number Diff line number Diff line change
1
+ typedef
2
+ void __stdcall
3
+ EVT_VIGEM_X360_NOTIFICATION (
4
+ void * Client ,
5
+ void * Target ,
6
+ unsigned char LargeMotor ,
7
+ unsigned char SmallMotor ,
8
+ unsigned char LedNumber ,
9
+ void * UserData
10
+ );
11
+
12
+ typedef EVT_VIGEM_X360_NOTIFICATION * PFN_VIGEM_X360_NOTIFICATION ;
You can’t perform that action at this time.
0 commit comments