Skip to content

Commit

Permalink
Fix compile errors and warnings when "thread" is disabled. (#134)
Browse files Browse the repository at this point in the history
Fix errors and warnings in c-scape/src/stdio.rs when the "thread"
feature is disabled.
  • Loading branch information
sunfishcode authored May 17, 2024
1 parent de6d8e8 commit ad97be3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions c-scape/src/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ unsafe extern "C" fn flockfile(file: *mut libc::FILE) {
{
(*file.cast::<FILE>()).flockfile_mutex.lock();
}

#[cfg(not(feature = "thread"))]
{
let _ = file;
}
}

#[no_mangle]
Expand All @@ -586,6 +591,11 @@ unsafe extern "C" fn funlockfile(file: *mut libc::FILE) {
{
(*file.cast::<FILE>()).flockfile_mutex.unlock();
}

#[cfg(not(feature = "thread"))]
{
let _ = file;
}
}

#[no_mangle]
Expand All @@ -600,6 +610,12 @@ unsafe extern "C" fn ftrylockfile(file: *mut libc::FILE) -> c_int {
-1
}
}

#[cfg(not(feature = "thread"))]
{
let _ = file;
0
}
}

#[no_mangle]
Expand Down

0 comments on commit ad97be3

Please sign in to comment.