Skip to content
Snippets Groups Projects
Verified Commit 4f187efc authored by jD91mZM2's avatar jD91mZM2
Browse files

Change BUFSIZ type to work with cbindgen

parent 243ce18e
No related branches found
No related tags found
No related merge requests found
use platform::types::*; use platform::types::*;
pub const EOF: c_int = -1; pub const EOF: c_int = -1;
pub const BUFSIZ: size_t = 1024; pub const BUFSIZ: c_int = 1024;
pub const UNGET: size_t = 8; pub const UNGET: c_int = 8;
pub const FILENAME_MAX: c_int = 4096; pub const FILENAME_MAX: c_int = 4096;
......
...@@ -17,7 +17,7 @@ impl GlobalFile { ...@@ -17,7 +17,7 @@ impl GlobalFile {
file, file,
flags: constants::F_PERM | flags, flags: constants::F_PERM | flags,
read_buf: Buffer::Owned(vec![0; BUFSIZ]), read_buf: Buffer::Owned(vec![0; BUFSIZ as usize]),
read_pos: 0, read_pos: 0,
read_size: 0, read_size: 0,
unget: None, unget: None,
......
...@@ -709,7 +709,7 @@ pub extern "C" fn setvbuf(stream: *mut FILE, buf: *mut c_char, mode: c_int, mut ...@@ -709,7 +709,7 @@ pub extern "C" fn setvbuf(stream: *mut FILE, buf: *mut c_char, mode: c_int, mut
// Set a buffer of size `size` if no buffer is given // Set a buffer of size `size` if no buffer is given
stream.read_buf = if buf.is_null() || size == 0 { stream.read_buf = if buf.is_null() || size == 0 {
if size == 0 { if size == 0 {
size = BUFSIZ; size = BUFSIZ as usize;
} }
// TODO: Make it unbuffered if _IONBF // TODO: Make it unbuffered if _IONBF
// if mode == _IONBF { // if mode == _IONBF {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment