Skip to content

Commit d5a1da5

Browse files
committed
Add missing extern "C"
Fixes #25
1 parent 7d1a176 commit d5a1da5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/myrustlib/src/mythreads.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::thread;
22
use std::time::Duration;
33

44
#[no_mangle]
5-
pub extern fn run_threads() {
5+
pub extern "C" fn run_threads() {
66
thread::spawn(|| {
77
for i in 1..10 {
88
println!("hi number {} from the spawned thread!", i);

src/myrustlib/src/random.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rand::random;
22

33
#[no_mangle]
4-
pub extern fn random_number() -> i32 {
4+
pub extern "C" fn random_number() -> i32 {
55
let tuple = random::<i32>();
66
tuple
77
}

0 commit comments

Comments
 (0)