We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d1a176 commit d5a1da5Copy full SHA for d5a1da5
2 files changed
src/myrustlib/src/mythreads.rs
@@ -2,7 +2,7 @@ use std::thread;
2
use std::time::Duration;
3
4
#[no_mangle]
5
-pub extern fn run_threads() {
+pub extern "C" fn run_threads() {
6
thread::spawn(|| {
7
for i in 1..10 {
8
println!("hi number {} from the spawned thread!", i);
src/myrustlib/src/random.rs
@@ -1,7 +1,7 @@
1
use rand::random;
-pub extern fn random_number() -> i32 {
+pub extern "C" fn random_number() -> i32 {
let tuple = random::<i32>();
tuple
}
0 commit comments