Skip to content

Commit 807d354

Browse files
committed
Fix ci
1 parent 8adf41d commit 807d354

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

examples/call-native-function/ExampleProject/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Runtime.InteropServices;
3+
using System.Runtime.Versioning;
34
using System.Text;
45

56
namespace ExampleProject {
@@ -11,12 +12,14 @@ public static unsafe int IndirectIncrement1(int n) {
1112
return rusty_increment(n);
1213
}
1314

15+
[SupportedOSPlatform("windows")]
1416
[UnmanagedCallersOnly]
1517
public static int IndirectIncrement2(int n) {
1618
return rusty_increment(n);
1719
}
1820

19-
[DllImport("call-native-function.exe")]
21+
[SupportedOSPlatform("windows")]
22+
[DllImport("call-native-function.exe", ExactSpelling = true)]
2023
public static extern int rusty_increment(int n);
2124
}
2225
}

examples/call-native-function/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fn main() {
2323
pdcstr!("IndirectIncrement1"),
2424
)
2525
.unwrap();
26+
#[cfg(windows)]
2627
let increment2 = delegate_loader
2728
.get_function_with_unmanaged_callers_only::<fn(i32) -> i32>(
2829
pdcstr!("ExampleProject.Program, ExampleProject"),
@@ -31,5 +32,6 @@ fn main() {
3132
.unwrap();
3233

3334
assert_eq!(2, increment1(1));
35+
#[cfg(windows)]
3436
assert_eq!(3, increment2(2));
3537
}

0 commit comments

Comments
 (0)