Use free Windows DDK and compile with latest MinGW releases.
[reactos.git] / reactos / lib / msvcrt / stdio / fflush.c
index 7848bb3..dda0faf 100644 (file)
 /* Copyright (C) 1998 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 <msvcrt/stdio.h>
-#include <msvcrt/errno.h>
-#include <msvcrt/sys/types.h>
-#include <msvcrt/sys/stat.h>
-#include <msvcrt/stdlib.h>
-#include <msvcrt/internal/file.h>
-#include <msvcrt/io.h>
+#include <msvcrti.h>
 
 
 int fflush(FILE *f)
@@ -72,7 +65,7 @@ int fflush(FILE *f)
 
     if ((f->_flag & _IOFBF) == _IOFBF) {
        if ( (f->_flag & _IOAHEAD) == _IOAHEAD )
-           _lseek(fileno(f),-rn, SEEK_CUR);
+           _lseek(_fileno(f),-rn, SEEK_CUR);
     }
 
     f->_flag &= ~_IOAHEAD;
@@ -86,7 +79,7 @@ int fflush(FILE *f)
 // better open the file in write through mode
 
     while (rn > 0) {
-      n = _write(fileno(f), base, rn);
+      n = _write(_fileno(f), base, rn);
       if (n <= 0) {
            f->_flag |= _IOERR;
            return EOF;