Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for https://github.com/rust-lang/libc/issues/2860 #2861

Merged
merged 1 commit into from Aug 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/windows/mod.rs
Expand Up @@ -277,6 +277,16 @@ impl ::Clone for fpos_t {
}
}

// Special handling for all print and scan type functions because of https://github.com/rust-lang/libc/issues/2860
#[cfg_attr(
all(windows, target_env = "msvc"),
link(name = "legacy_stdio_definitions")
)]
extern "C" {
pub fn printf(format: *const c_char, ...) -> ::c_int;
pub fn fprintf(stream: *mut FILE, format: *const c_char, ...) -> ::c_int;
}

extern "C" {
pub fn isalnum(c: c_int) -> c_int;
pub fn isalpha(c: c_int) -> c_int;
Expand Down Expand Up @@ -319,8 +329,6 @@ extern "C" {
pub fn feof(stream: *mut FILE) -> c_int;
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn perror(s: *const c_char);
pub fn printf(format: *const c_char, ...) -> ::c_int;
pub fn fprintf(stream: *mut FILE, format: *const c_char, ...) -> ::c_int;
pub fn atoi(s: *const c_char) -> c_int;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
Expand Down