From ed652442176aea086104479bb31aced501df48a2 Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Mon, 22 Jul 2024 12:20:46 +0200 Subject: rules-rust: bugfix: correctly propagate link args of C dependencies --- test/c-from-rust/rust_interface/foo.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/c-from-rust/rust_interface/foo.rs (limited to 'test/c-from-rust/rust_interface/foo.rs') diff --git a/test/c-from-rust/rust_interface/foo.rs b/test/c-from-rust/rust_interface/foo.rs new file mode 100644 index 0000000..acfe2a7 --- /dev/null +++ b/test/c-from-rust/rust_interface/foo.rs @@ -0,0 +1,11 @@ +// declaration of the function implemented in the C library +extern "C" { + pub fn c_func(input: i32) -> i32; +} + +// wrapper to call the C function +pub fn c_call(i:i32) -> i32{ + unsafe { + return c_func(i); + } +} -- cgit v1.2.3