Use free Windows DDK and compile with latest MinGW releases.
[reactos.git] / reactos / lib / msvcrt / stdio / filbuf.c
index 5033a60..8599503 100644 (file)
@@ -1,15 +1,8 @@
 /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+#include <msvcrti.h>
 
-#include <msvcrt/stdio.h>
-#include <msvcrt/sys/types.h>
-#include <msvcrt/stdlib.h>
-#include <msvcrt/string.h>
-#include <msvcrt/internal/file.h>
-#include <msvcrt/io.h>
-#include <msvcrt/wchar.h>
-#include <msvcrt/errno.h>
 
 int _readcnv(int fn, void *buf, size_t siz  );
 
@@ -64,7 +57,7 @@ _filbuf(FILE *f)
 
 
 
-  f->_cnt = _read(fileno(f), f->_base, f->_flag & _IONBF ? 1 : f->_bufsiz  );
+  f->_cnt = _read(_fileno(f), f->_base, f->_flag & _IONBF ? 1 : f->_bufsiz  );
   f->_flag |= _IOAHEAD;
 
   if(__is_text_file(f) && f->_cnt>0)
@@ -74,7 +67,7 @@ _filbuf(FILE *f)
     if(cz)
     {
       int newcnt = cz - f->_base;
-      lseek(fileno(f), -(f->_cnt - newcnt), SEEK_CUR);
+      _lseek(_fileno(f), -(f->_cnt - newcnt), SEEK_CUR);
       f->_cnt = newcnt;
     }
   }