Skip to content

Commit e94f68c

Browse files
committed
Link against correct scanf,fscanf,sscanf
1 parent 9df115b commit e94f68c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/unix/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,11 @@ extern {
512512
pub fn snprintf(s: *mut ::c_char, n: ::size_t,
513513
format: *const ::c_char, ...) -> ::c_int;
514514
pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
515+
#[cfg_attr(target_os = "linux", link_name = "__isoc99_fscanf")]
515516
pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
517+
#[cfg_attr(target_os = "linux", link_name = "__isoc99_scanf")]
516518
pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
519+
#[cfg_attr(target_os = "linux", link_name = "__isoc99_sscanf")]
517520
pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
518521
pub fn getchar_unlocked() -> ::c_int;
519522
pub fn putchar_unlocked(c: ::c_int) -> ::c_int;

0 commit comments

Comments
 (0)