Index: trunk/src/msvcrt/file.c
===================================================================
--- trunk/src/msvcrt/file.c	(revision 21398)
+++ trunk/src/msvcrt/file.c	(revision 21402)
@@ -35,4 +35,5 @@
 #include <time.h>
 
+#ifndef __MINIVCRT__
 
 #include "winternl.h"
@@ -59,4 +60,22 @@
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
+#else /* !__MINIVCRT__ */
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <wctype.h>
+
+#include <winerror.h>
+
+#include "minivcrt.h"
+#include "minivcrt_internal.h"
+
+#include "winternl.h"
+#include "wine/unicode.h"
+
+#endif /* !__MINIVCRT__ */
+
+#ifndef __MINIVCRT__
+
 /* for stat mode, permissions apply to all,owner and group */
 #define MSVCRT_S_IREAD  (_S_IREAD  | (_S_IREAD  >> 3) | (_S_IREAD  >> 6))
@@ -66,5 +85,4 @@
 /* _access() bit flags FIXME: incomplete */
 #define MSVCRT_W_OK      0x02
-
 
 /* FIXME: Make this dynamic */
@@ -94,4 +112,20 @@
 static const unsigned int COM = 'c' << 16 | 'o' << 8 | 'm';
 
+#else /* !__MINIVCRT__ */
+
+/* for stat mode, permissions apply to all,owner and group */
+#define MSVCRT_S_IREAD  (S_IRUSR | S_IRGRP | S_IROTH)
+#define MSVCRT_S_IWRITE (S_IWUSR | S_IWGRP | S_IWOTH)
+#define MSVCRT_S_IEXEC  (S_IXUSR | S_IXGRP | S_IXOTH)
+
+#define MSVCRT_W_OK     W_OK
+#define _S_IWRITE       S_IWUSR
+#define _S_IFDIR        S_IFDIR
+#define _S_IFREG        S_IFREG
+
+#define MSVCRT_iswalpha iswalpha
+
+#endif /* !__MINIVCRT__ */
+
 #define TOUL(x) (ULONGLONG)(x)
 static const ULONGLONG WCEXE = TOUL('e') << 32 | TOUL('x') << 16 | TOUL('e');
@@ -99,4 +133,6 @@
 static const ULONGLONG WCCMD = TOUL('c') << 32 | TOUL('m') << 16 | TOUL('d');
 static const ULONGLONG WCCOM = TOUL('c') << 32 | TOUL('o') << 16 | TOUL('m');
+
+#ifndef __MINIVCRT__
 
 extern CRITICAL_SECTION MSVCRT_file_cs;
@@ -296,4 +332,6 @@
 }
 
+#endif /* !__MINIVCRT__ */
+
 /*********************************************************************
  *		_waccess (MSVCRT.@)
@@ -318,4 +356,6 @@
 }
 
+#ifndef __MINIVCRT__
+
 /*********************************************************************
  *		_chmod (MSVCRT.@)
@@ -339,4 +379,6 @@
 }
 
+#endif /* !__MINIVCRT__ */
+
 /*********************************************************************
  *		_wchmod (MSVCRT.@)
@@ -359,4 +401,6 @@
   return -1;
 }
+
+#ifndef __MINIVCRT__
 
 /*********************************************************************
@@ -373,4 +417,6 @@
 }
 
+#endif /* !__MINIVCRT__ */
+
 /*********************************************************************
  *		_wunlink (MSVCRT.@)
@@ -385,4 +431,6 @@
   return -1;
 }
+
+#ifndef __MINIVCRT__
 
 /*********************************************************************
@@ -870,4 +918,6 @@
 }
 
+#endif /* !__MINIVCRT__ */
+
 /*********************************************************************
  *		_wmktemp (MSVCRT.@)
@@ -903,4 +953,6 @@
   return NULL;
 }
+
+#ifndef __MINIVCRT__
 
 /*********************************************************************
@@ -1310,4 +1362,6 @@
 }
 
+#endif /* !__MINIVCRT__ */
+
 /*********************************************************************
  *		_wstat (MSVCRT.@)
@@ -1371,4 +1425,6 @@
 }
 
+#ifndef __MINIVCRT__
+
 /*********************************************************************
  *		_tell (MSVCRT.@)
@@ -1396,4 +1452,6 @@
 }
 
+#endif /* !__MINIVCRT__ */
+
 /*********************************************************************
  *		_wtempnam (MSVCRT.@)
@@ -1412,4 +1470,6 @@
   return NULL;
 }
+
+#ifndef __MINIVCRT__
 
 /*********************************************************************
@@ -2241,4 +2301,6 @@
 }
 
+#endif /* !__MINIVCRT__ */
+
 /*********************************************************************
  *		_wremove (MSVCRT.@)
@@ -2254,4 +2316,6 @@
 }
 
+#ifndef __MINIVCRT__
+
 /*********************************************************************
  *		scanf (MSVCRT.@)
@@ -2295,4 +2359,6 @@
 }
 
+#endif /* !__MINIVCRT__ */
+
 /*********************************************************************
  *		_wrename (MSVCRT.@)
@@ -2307,4 +2373,6 @@
   return -1;
 }
+
+#ifndef __MINIVCRT__
 
 /*********************************************************************
@@ -2545,2 +2613,4 @@
   return 0;
 }
+
+#endif /* !__MINIVCRT__ */
Index: trunk/src/msvcrt/minivcrt.mak
===================================================================
--- trunk/src/msvcrt/minivcrt.mak	(revision 21398)
+++ trunk/src/msvcrt/minivcrt.mak	(revision 21402)
@@ -33,4 +33,5 @@
 $(OBJDIR)\environ.obj \
 $(OBJDIR)\errno.obj \
+$(OBJDIR)\file.obj \
 $(OBJDIR)\wcs.obj
 
Index: trunk/src/msvcrt/wcs.c
===================================================================
--- trunk/src/msvcrt/wcs.c	(revision 21398)
+++ trunk/src/msvcrt/wcs.c	(revision 21402)
@@ -182,4 +182,6 @@
 }
 
+#ifndef __MINIVCRT__
+
 /*********************************************************************
  *		iswalnum (MSVCRT.@)
@@ -270,2 +272,3 @@
 }
 
+#endif /* !__MINIVCRT__ */
