File tree Expand file tree Collapse file tree 2 files changed +30
-11
lines changed Expand file tree Collapse file tree 2 files changed +30
-11
lines changed Original file line number Diff line number Diff line change 11
11
12
12
jobs :
13
13
test :
14
- runs-on : windows-latest
14
+ runs-on : ${{ matrix.os }}
15
15
strategy :
16
- matrix :
17
- rust : [stable]
16
+ matrix :
17
+ include :
18
+ - os : windows-latest
19
+ rust : stable
20
+ other : x86_64-pc-windows-msvc
21
+ - os : ubuntu-latest
22
+ rust : stable
23
+ other : i686-unknown-linux-gnu
18
24
steps :
19
25
- uses : actions/checkout@v2
20
26
- uses : actions-rs/toolchain@v1
24
30
override : true
25
31
components : rustfmt
26
32
27
- - name : tests
33
+ - name : build
34
+ run : cargo build
35
+ if : matrix.os == 'ubuntu-latest'
36
+
37
+ - name : test
28
38
run : cargo test --all
39
+ if : matrix.os == 'windows-latest'
29
40
30
41
- name : fmt
31
42
run : cargo fmt --all -- --check
32
- if : matrix.rust == 'stable '
43
+ if : matrix.os == 'windows-latest '
Original file line number Diff line number Diff line change @@ -50,13 +50,21 @@ impl Function {
50
50
link = "onecoreuap" ;
51
51
}
52
52
53
- quote ! {
54
- pub unsafe fn #name<#constraints>( #params) #return_type {
55
- #[ link( name = #link) ]
56
- extern "system" {
57
- pub fn #name( #( #abi_params) , * ) #abi_return_type;
53
+ if cfg ! ( windows) {
54
+ quote ! {
55
+ pub unsafe fn #name<#constraints>( #params) #return_type {
56
+ #[ link( name = #link) ]
57
+ extern "system" {
58
+ pub fn #name( #( #abi_params) , * ) #abi_return_type;
59
+ }
60
+ #name( #( #args) , * )
61
+ }
62
+ }
63
+ } else {
64
+ quote ! {
65
+ pub unsafe fn #name<#constraints>( #params) #return_type {
66
+ panic!( "Unsupported target OS" ) ;
58
67
}
59
- #name( #( #args) , * )
60
68
}
61
69
}
62
70
}
You can’t perform that action at this time.
0 commit comments