@@ -53,7 +53,7 @@ use container::Container;
53
53
use int;
54
54
use iterator:: Iterator ;
55
55
use libc:: consts:: os:: posix88:: * ;
56
- use libc:: { c_int, c_long , c_void, size_t, ssize_t } ;
56
+ use libc:: { c_int, c_void, size_t} ;
57
57
use libc;
58
58
use num;
59
59
use ops:: Drop ;
@@ -970,7 +970,7 @@ impl Reader for *libc::FILE {
970
970
971
971
unsafe {
972
972
assert ! ( libc:: fseek( * self ,
973
- offset as c_long,
973
+ offset as libc :: c_long,
974
974
convert_whence( whence) ) == 0 as c_int) ;
975
975
}
976
976
}
@@ -1199,7 +1199,7 @@ impl Writer for *libc::FILE {
1199
1199
1200
1200
unsafe {
1201
1201
assert ! ( libc:: fseek( * self ,
1202
- offset as c_long,
1202
+ offset as libc :: c_long,
1203
1203
convert_whence( whence) ) == 0 as c_int) ;
1204
1204
}
1205
1205
}
@@ -1240,13 +1240,23 @@ impl Writer for fd_t {
1240
1240
fn write ( & self , v : & [ u8 ] ) {
1241
1241
#[ fixed_stack_segment] ; #[ inline( never) ] ;
1242
1242
1243
+ #[ cfg( windows) ]
1244
+ type IoSize = libc:: c_uint ;
1245
+ #[ cfg( windows) ]
1246
+ type IoRet = c_int ;
1247
+
1248
+ #[ cfg( unix) ]
1249
+ type IoSize = size_t ;
1250
+ #[ cfg( unix) ]
1251
+ type IoRet = libc:: ssize_t ;
1252
+
1243
1253
unsafe {
1244
1254
let mut count = 0 u;
1245
1255
do v. as_imm_buf |vbuf, len| {
1246
1256
while count < len {
1247
1257
let vb = ptr:: offset ( vbuf, count as int ) as * c_void ;
1248
- let nout = libc:: write ( * self , vb, len as size_t ) ;
1249
- if nout < 0 as ssize_t {
1258
+ let nout = libc:: write ( * self , vb, len as IoSize ) ;
1259
+ if nout < 0 as IoRet {
1250
1260
error ! ( "error writing buffer" ) ;
1251
1261
error ! ( "%s" , os:: last_os_error( ) ) ;
1252
1262
fail ! ( ) ;
0 commit comments