Skip to content

Commit

Permalink
Auto merge of rust-lang#263 - bluss:printf, r=alexcrichton
Browse files Browse the repository at this point in the history
Add the family of printf, scanf functions

snprintf is apparently supported in MSVC since version 14. I'm curious to take the tests for a spin.
  • Loading branch information
bors committed Apr 13, 2016
2 parents ba084f4 + 1ebfe63 commit bab6a37
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,16 @@ cfg_if! {
}

extern {
pub fn fprintf(stream: *mut ::FILE,
format: *const ::c_char, ...) -> ::c_int;
pub fn printf(format: *const ::c_char, ...) -> ::c_int;
pub fn snprintf(s: *mut ::c_char, n: ::size_t,
format: *const ::c_char, ...) -> ::c_int;
pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;

#[cfg_attr(target_os = "netbsd", link_name = "__socket30")]
pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
Expand Down

0 comments on commit bab6a37

Please sign in to comment.