Skip to content

Commit d8ef24c

Browse files
committed
add extern "C" to lib function signature
Signed-off-by: Ryan1729 <Ryan1729@gmail.com>
1 parent 9a508aa commit d8ef24c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl Application {
3535
fn new_state(&self) -> State {
3636
unsafe {
3737
let f = self.library
38-
.get::<fn() -> State>(b"lib_new_state\0")
38+
.get::<extern "C" fn() -> State>(b"lib_new_state\0")
3939
.unwrap();
4040

4141
f()
@@ -45,7 +45,7 @@ impl Application {
4545
fn update_and_render(&self, platform: &Platform, state: &mut State) {
4646
unsafe {
4747
let f = self.library
48-
.get::<fn(&Platform, &mut State)>(b"lib_update_and_render\0")
48+
.get::<extern "C" fn(&Platform, &mut State)>(b"lib_update_and_render\0")
4949
.unwrap();
5050
f(platform, state)
5151
}

0 commit comments

Comments
 (0)