[RFC] [MSVCRT] Removing the MSVCRT() hack

Dimitrie O. Paun dpaun at rogers.com
Fri Jun 18 00:58:59 CDT 2004


Here is a patch that separates the implementation headers
from the public ones. It's not yet ready for inclusion,
but it's pretty close, so I'm sending it off to the list
for comments.

Some of the things in here:
  -- cleanup of naming conventions. Things shared with the
     public header *always* start with MSVCRT_
  -- stuff that's private, doesn't start with MSVCRT_
     From this two rules follows that a symbol starts
     with MSVCRT_ if and only if it's shared with the
     public headers, where it appears without MSVCRT_
  -- most private functions start with msvcrt_ now,
     a convetion that was already in place, but not
     followed to the letter
  -- there is a sh script that uses this simple rule
     to generate the test file. Do we integrate the
     script with the build system?

What's left to do:
  -- if we keep the test generation script, it needs to
     get integrated in the build system
  -- there are still a bunch of functions that are shared
     with the public headers that don't have the MSVCRT_
     prefix. They need to be renamed
  -- more cleanup in the public headers, remove the
     MSVCRT_ from the sentries.

Comments, flames, etc. appreciated. It's been sitting on my
HD long enough, it's time to get it into the tree.

-- 
Dimi.


Index: include/msvcrt/conio.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/conio.h,v
retrieving revision 1.5
diff -u -r1.5 conio.h
--- include/msvcrt/conio.h	18 Jul 2003 22:57:15 -0000	1.5
+++ include/msvcrt/conio.h	16 Jun 2004 05:54:16 -0000
@@ -39,7 +39,6 @@
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 static inline char* cgets(char* str) { return _cgets(str); }
 static inline int cputs(const char* str) { return _cputs(str); }
 static inline int getch(void) { return _getch(); }
@@ -62,6 +61,4 @@
 #define cscanf _cscanf
 #endif /* __GNUC__ */
 
-#endif /* USE_MSVCRT_PREFIX */
-
 #endif /* __WINE_CONIO_H */
Index: include/msvcrt/ctype.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/ctype.h,v
retrieving revision 1.6
diff -u -r1.6 ctype.h
--- include/msvcrt/ctype.h	26 Apr 2004 23:31:39 -0000	1.6
+++ include/msvcrt/ctype.h	16 Jun 2004 05:54:16 -0000
@@ -11,14 +11,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -26,23 +18,17 @@
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
-# ifndef WEOF
-#  define WEOF        (wint_t)(0xFFFF)
-# endif
-#else
-# ifndef MSVCRT_WEOF
-#  define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
-# endif
-#endif /* USE_MSVCRT_PREFIX */
+#ifndef WEOF
+#define WEOF        (wint_t)(0xFFFF)
+#endif
 
 #ifndef _WCTYPE_T_DEFINED
-typedef unsigned short  MSVCRT(wint_t);
-typedef unsigned short  MSVCRT(wctype_t);
+typedef unsigned short  wint_t;
+typedef unsigned short  wctype_t;
 #define _WCTYPE_T_DEFINED
 #endif
 
@@ -58,46 +44,46 @@
 #define _LEADBYTE     0x8000
 #define _ALPHA       (0x0100|_UPPER|_LOWER)  /* (C1_ALPHA|_UPPER|_LOWER) */
 
-int MSVCRT(__isascii)(int);
-int MSVCRT(__iscsym)(int);
-int MSVCRT(__iscsymf)(int);
-int MSVCRT(__toascii)(int);
-int MSVCRT(_isctype)(int,int);
-int MSVCRT(_tolower)(int);
-int MSVCRT(_toupper)(int);
-int MSVCRT(isalnum)(int);
-int MSVCRT(isalpha)(int);
-int MSVCRT(iscntrl)(int);
-int MSVCRT(isdigit)(int);
-int MSVCRT(isgraph)(int);
-int MSVCRT(islower)(int);
-int MSVCRT(isprint)(int);
-int MSVCRT(ispunct)(int);
-int MSVCRT(isspace)(int);
-int MSVCRT(isupper)(int);
-int MSVCRT(isxdigit)(int);
-int MSVCRT(tolower)(int);
-int MSVCRT(toupper)(int);
+int __isascii(int);
+int __iscsym(int);
+int __iscsymf(int);
+int __toascii(int);
+int _isctype(int,int);
+int _tolower(int);
+int _toupper(int);
+int isalnum(int);
+int isalpha(int);
+int iscntrl(int);
+int isdigit(int);
+int isgraph(int);
+int islower(int);
+int isprint(int);
+int ispunct(int);
+int isspace(int);
+int isupper(int);
+int isxdigit(int);
+int tolower(int);
+int toupper(int);
 
 #ifndef MSVCRT_WCTYPE_DEFINED
 #define MSVCRT_WCTYPE_DEFINED
-int MSVCRT(is_wctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
-int MSVCRT(isleadbyte)(int);
-int MSVCRT(iswalnum)(MSVCRT(wint_t));
-int MSVCRT(iswalpha)(MSVCRT(wint_t));
-int MSVCRT(iswascii)(MSVCRT(wint_t));
-int MSVCRT(iswcntrl)(MSVCRT(wint_t));
-int MSVCRT(iswctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
-int MSVCRT(iswdigit)(MSVCRT(wint_t));
-int MSVCRT(iswgraph)(MSVCRT(wint_t));
-int MSVCRT(iswlower)(MSVCRT(wint_t));
-int MSVCRT(iswprint)(MSVCRT(wint_t));
-int MSVCRT(iswpunct)(MSVCRT(wint_t));
-int MSVCRT(iswspace)(MSVCRT(wint_t));
-int MSVCRT(iswupper)(MSVCRT(wint_t));
-int MSVCRT(iswxdigit)(MSVCRT(wint_t));
-MSVCRT(wchar_t) MSVCRT(towlower)(MSVCRT(wchar_t));
-MSVCRT(wchar_t) MSVCRT(towupper)(MSVCRT(wchar_t));
+int is_wctype(wint_t,wctype_t);
+int isleadbyte(int);
+int iswalnum(wint_t);
+int iswalpha(wint_t);
+int iswascii(wint_t);
+int iswcntrl(wint_t);
+int iswctype(wint_t,wctype_t);
+int iswdigit(wint_t);
+int iswgraph(wint_t);
+int iswlower(wint_t);
+int iswprint(wint_t);
+int iswpunct(wint_t);
+int iswspace(wint_t);
+int iswupper(wint_t);
+int iswxdigit(wint_t);
+wchar_t towlower(wchar_t);
+wchar_t towupper(wchar_t);
 #endif /* MSVCRT_WCTYPE_DEFINED */
 
 #ifdef __cplusplus
@@ -105,11 +91,9 @@
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 static inline int isascii(int c) { return __isascii(c); }
 static inline int iscsym(int c) { return __iscsym(c); }
 static inline int iscsymf(int c) { return __iscsymf(c); }
 static inline int toascii(int c) { return __toascii(c); }
-#endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_CTYPE_H */
Index: include/msvcrt/direct.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/direct.h,v
retrieving revision 1.6
diff -u -r1.6 direct.h
--- include/msvcrt/direct.h	16 Mar 2004 19:17:11 -0000	1.6
+++ include/msvcrt/direct.h	16 Jun 2004 05:54:16 -0000
@@ -11,14 +11,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -26,18 +18,18 @@
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
 #ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
+typedef unsigned int size_t;
 #define MSVCRT_SIZE_T_DEFINED
 #endif
 
 #ifndef MSVCRT_DISKFREE_T_DEFINED
 #define MSVCRT_DISKFREE_T_DEFINED
-struct MSVCRT(_diskfree_t) {
+struct _diskfree_t {
   unsigned int total_clusters;
   unsigned int avail_clusters;
   unsigned int sectors_per_cluster;
@@ -56,11 +48,11 @@
 
 #ifndef MSVCRT_WDIRECT_DEFINED
 #define MSVCRT_WDIRECT_DEFINED
-int              _wchdir(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)* _wgetcwd(MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)* _wgetdcwd(int,MSVCRT(wchar_t)*,int);
-int              _wmkdir(const MSVCRT(wchar_t)*);
-int              _wrmdir(const MSVCRT(wchar_t)*);
+int              _wchdir(const wchar_t*);
+wchar_t* _wgetcwd(wchar_t*,int);
+wchar_t* _wgetdcwd(int,wchar_t*,int);
+int              _wmkdir(const wchar_t*);
+int              _wrmdir(const wchar_t*);
 #endif /* MSVCRT_WDIRECT_DEFINED */
 
 #ifdef __cplusplus
Index: include/msvcrt/dos.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/dos.h,v
retrieving revision 1.5
diff -u -r1.5 dos.h
--- include/msvcrt/dos.h	16 Mar 2004 19:17:11 -0000	1.5
+++ include/msvcrt/dos.h	16 Jun 2004 05:54:16 -0000
@@ -22,7 +22,7 @@
 
 #ifndef MSVCRT_DISKFREE_T_DEFINED
 #define MSVCRT_DISKFREE_T_DEFINED
-struct MSVCRT(_diskfree_t) {
+struct _diskfree_t {
   unsigned int total_clusters;
   unsigned int avail_clusters;
   unsigned int sectors_per_cluster;
@@ -35,7 +35,7 @@
 extern "C" {
 #endif
 
-unsigned int MSVCRT(_getdiskfree)(unsigned int, struct MSVCRT(_diskfree_t) *);
+unsigned int _getdiskfree(unsigned int, struct _diskfree_t *);
 
 #ifdef __cplusplus
 }
@@ -43,7 +43,7 @@
 
 
 #ifndef USE_MSVCRT_PREFIX
-#define MSVCRT(diskfree_t) MSVCRT(_diskfree_t)
+#define diskfree_t _diskfree_t
 #endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_DOS_H */
Index: include/msvcrt/eh.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/eh.h,v
retrieving revision 1.7
diff -u -r1.7 eh.h
--- include/msvcrt/eh.h	18 Jul 2003 22:57:15 -0000	1.7
+++ include/msvcrt/eh.h	16 Jun 2004 05:54:16 -0000
@@ -27,14 +27,6 @@
 #error "eh.h is meant only for C++ applications"
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 struct _EXCEPTION_POINTERS;
 
 typedef void (*terminate_handler)();
@@ -43,11 +35,11 @@
 typedef void (*unexpected_function)();
 typedef void (*_se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info);
 
-terminate_function MSVCRT(set_terminate)(terminate_function func);
-unexpected_function MSVCRT(set_unexpected)(unexpected_function func);
-_se_translator_function MSVCRT(_set_se_translator)(_se_translator_function func);
+terminate_function set_terminate(terminate_function func);
+unexpected_function set_unexpected(unexpected_function func);
+_se_translator_function _set_se_translator(_se_translator_function func);
 
-void        MSVCRT(terminate)();
-void        MSVCRT(unexpected)();
+void        terminate();
+void        unexpected();
 
 #endif /* __WINE_EH_H */
Index: include/msvcrt/errno.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/errno.h,v
retrieving revision 1.5
diff -u -r1.5 errno.h
--- include/msvcrt/errno.h	18 Jul 2003 22:57:15 -0000	1.5
+++ include/msvcrt/errno.h	16 Jun 2004 05:54:16 -0000
@@ -22,57 +22,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifdef USE_MSVCRT_PREFIX
-
-#  define MSVCRT_EPERM   1
-#  define MSVCRT_ENOENT  2
-#  define MSVCRT_ESRCH   3
-#  define MSVCRT_EINTR   4
-#  define MSVCRT_EIO     5
-#  define MSVCRT_ENXIO   6
-#  define MSVCRT_E2BIG   7
-#  define MSVCRT_ENOEXEC 8
-#  define MSVCRT_EBADF   9
-#  define MSVCRT_ECHILD  10
-#  define MSVCRT_EAGAIN  11
-#  define MSVCRT_ENOMEM  12
-#  define MSVCRT_EACCES  13
-#  define MSVCRT_EFAULT  14
-#  define MSVCRT_EBUSY   16
-#  define MSVCRT_EEXIST  17
-#  define MSVCRT_EXDEV   18
-#  define MSVCRT_ENODEV  19
-#  define MSVCRT_ENOTDIR 20
-#  define MSVCRT_EISDIR  21
-#  define MSVCRT_EINVAL  22
-#  define MSVCRT_ENFILE  23
-#  define MSVCRT_EMFILE  24
-#  define MSVCRT_ENOTTY  25
-#  define MSVCRT_EFBIG   27
-#  define MSVCRT_ENOSPC  28
-#  define MSVCRT_ESPIPE  29
-#  define MSVCRT_EROFS   30
-#  define MSVCRT_EMLINK  31
-#  define MSVCRT_EPIPE   32
-#  define MSVCRT_EDOM    33
-#  define MSVCRT_ERANGE  34
-#  define MSVCRT_EDEADLK 36
-#  define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
-#  define MSVCRT_ENAMETOOLONG 38
-#  define MSVCRT_ENOLCK  39
-#  define MSVCRT_ENOSYS  40
-#  define MSVCRT_ENOTEMPTY 41
-
-#else /* USE_MSVCRT_PREFIX */
-
 #  define EPERM   1
 #  define ENOENT  2
 #  define ESRCH   3
@@ -112,22 +61,16 @@
 #  define ENOSYS  40
 #  define ENOTEMPTY 41
 
-#endif /* USE_MSVCRT_PREFIX */
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-extern int* MSVCRT(_errno)(void);
+extern int* _errno(void);
 
 #ifdef __cplusplus
 }
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
-# define errno        (*_errno())
-#else
-# define MSVCRT_errno (*MSVCRT__errno())
-#endif
+#define errno        (*_errno())
 
 #endif  /* __WINE_ERRNO_H */
Index: include/msvcrt/float.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/float.h,v
retrieving revision 1.2
diff -u -r1.2 float.h
--- include/msvcrt/float.h	25 Mar 2004 23:36:14 -0000	1.2
+++ include/msvcrt/float.h	16 Jun 2004 05:54:16 -0000
@@ -12,14 +12,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
Index: include/msvcrt/io.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/io.h,v
retrieving revision 1.7
diff -u -r1.7 io.h
--- include/msvcrt/io.h	16 Mar 2004 19:17:11 -0000	1.7
+++ include/msvcrt/io.h	16 Jun 2004 05:55:12 -0000
@@ -11,18 +11,10 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -42,33 +34,33 @@
 #define _A_ARCH   0x00000020
 
 #ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
+typedef long time_t;
 #define MSVCRT_TIME_T_DEFINED
 #endif
 
 #ifndef MSVCRT_FSIZE_T_DEFINED
-typedef unsigned long MSVCRT(_fsize_t);
+typedef unsigned long _fsize_t;
 #define MSVCRT_FSIZE_T_DEFINED
 #endif
 
 #ifndef MSVCRT_FINDDATA_T_DEFINED
 #define MSVCRT_FINDDATA_T_DEFINED
-struct MSVCRT(_finddata_t)
+struct _finddata_t
 {
   unsigned attrib;
-  MSVCRT(time_t)   time_create;
-  MSVCRT(time_t)   time_access;
-  MSVCRT(time_t)   time_write;
-  MSVCRT(_fsize_t) size;
+  time_t   time_create;
+  time_t   time_access;
+  time_t   time_write;
+  _fsize_t size;
   char             name[260];
 };
 
-struct MSVCRT(_finddatai64_t)
+struct _finddatai64_t
 {
   unsigned attrib;
-  MSVCRT(time_t) time_create;
-  MSVCRT(time_t) time_access;
-  MSVCRT(time_t) time_write;
+  time_t time_create;
+  time_t time_access;
+  time_t time_write;
   __int64        size;
   char           name[260];
 };
@@ -76,22 +68,22 @@
 
 #ifndef MSVCRT_WFINDDATA_T_DEFINED
 #define MSVCRT_WFINDDATA_T_DEFINED
-struct MSVCRT(_wfinddata_t) {
+struct _wfinddata_t {
   unsigned attrib;
-  MSVCRT(time_t)   time_create;
-  MSVCRT(time_t)   time_access;
-  MSVCRT(time_t)   time_write;
-  MSVCRT(_fsize_t) size;
-  MSVCRT(wchar_t)  name[260];
+  time_t   time_create;
+  time_t   time_access;
+  time_t   time_write;
+  _fsize_t size;
+  wchar_t  name[260];
 };
 
-struct MSVCRT(_wfinddatai64_t) {
+struct _wfinddatai64_t {
   unsigned attrib;
-  MSVCRT(time_t)  time_create;
-  MSVCRT(time_t)  time_access;
-  MSVCRT(time_t)  time_write;
+  time_t  time_create;
+  time_t  time_access;
+  time_t  time_write;
   __int64         size;
-  MSVCRT(wchar_t) name[260];
+  wchar_t name[260];
 };
 #endif /* MSVCRT_WFINDDATA_T_DEFINED */
 
@@ -111,10 +103,10 @@
 __int64     _filelengthi64(int);
 long        _filelength(int);
 int         _findclose(long);
-long        MSVCRT(_findfirst)(const char*,struct MSVCRT(_finddata_t)*);
-long        MSVCRT(_findfirsti64)(const char*, struct MSVCRT(_finddatai64_t)*);
-int         MSVCRT(_findnext)(long,struct MSVCRT(_finddata_t)*);
-int         MSVCRT(_findnexti64)(long, struct MSVCRT(_finddatai64_t)*);
+long        _findfirst(const char*,struct _finddata_t*);
+long        _findfirsti64(const char*, struct _finddatai64_t*);
+int         _findnext(long,struct _finddata_t*);
+int         _findnexti64(long, struct _finddatai64_t*);
 long        _get_osfhandle(int);
 int         _isatty(int);
 int         _locking(int,int,long);
@@ -133,23 +125,23 @@
 int         _unlink(const char*);
 int         _write(int,const void*,unsigned int);
 
-int         MSVCRT(remove)(const char*);
-int         MSVCRT(rename)(const char*,const char*);
+int         remove(const char*);
+int         rename(const char*,const char*);
 
 #ifndef MSVCRT_WIO_DEFINED
 #define MSVCRT_WIO_DEFINED
-int         _waccess(const MSVCRT(wchar_t)*,int);
-int         _wchmod(const MSVCRT(wchar_t)*,int);
-int         _wcreat(const MSVCRT(wchar_t)*,int);
-long        MSVCRT(_wfindfirst)(const MSVCRT(wchar_t)*,struct MSVCRT(_wfinddata_t)*);
-long        MSVCRT(_wfindfirsti64)(const MSVCRT(wchar_t)*, struct MSVCRT(_wfinddatai64_t)*);
-int         MSVCRT(_wfindnext)(long,struct MSVCRT(_wfinddata_t)*);
-int         MSVCRT(_wfindnexti64)(long, struct MSVCRT(_wfinddatai64_t)*);
-MSVCRT(wchar_t)*_wmktemp(MSVCRT(wchar_t)*);
-int         _wopen(const MSVCRT(wchar_t)*,int,...);
-int         _wrename(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int         _wsopen(const MSVCRT(wchar_t)*,int,int,...);
-int         _wunlink(const MSVCRT(wchar_t)*);
+int         _waccess(const wchar_t*,int);
+int         _wchmod(const wchar_t*,int);
+int         _wcreat(const wchar_t*,int);
+long        _wfindfirst(const wchar_t*,struct _wfinddata_t*);
+long        _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
+int         _wfindnext(long,struct _wfinddata_t*);
+int         _wfindnexti64(long, struct _wfinddatai64_t*);
+wchar_t*_wmktemp(wchar_t*);
+int         _wopen(const wchar_t*,int,...);
+int         _wrename(const wchar_t*,const wchar_t*);
+int         _wsopen(const wchar_t*,int,int,...);
+int         _wunlink(const wchar_t*);
 #endif /* MSVCRT_WIO_DEFINED */
 
 #ifdef __cplusplus
@@ -192,6 +184,6 @@
 #define sopen _sopen
 #endif /* __GNUC__ */
 
-#endif /* USE _MSVCRT_PREFIX */
+#endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_IO_H */
Index: include/msvcrt/locale.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/locale.h,v
retrieving revision 1.5
diff -u -r1.5 locale.h
--- include/msvcrt/locale.h	18 Jul 2003 22:57:15 -0000	1.5
+++ include/msvcrt/locale.h	16 Jun 2004 05:54:16 -0000
@@ -23,31 +23,13 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
-#ifdef USE_MSVCRT_PREFIX
-#define MSVCRT_LC_ALL          0
-#define MSVCRT_LC_COLLATE      1
-#define MSVCRT_LC_CTYPE        2
-#define MSVCRT_LC_MONETARY     3
-#define MSVCRT_LC_NUMERIC      4
-#define MSVCRT_LC_TIME         5
-#define MSVCRT_LC_MIN          MSVCRT_LC_ALL
-#define MSVCRT_LC_MAX          MSVCRT_LC_TIME
-#else
 #define LC_ALL                 0
 #define LC_COLLATE             1
 #define LC_CTYPE               2
@@ -56,11 +38,10 @@
 #define LC_TIME                5
 #define LC_MIN                 LC_ALL
 #define LC_MAX                 LC_TIME
-#endif /* USE_MSVCRT_PREFIX */
 
 #ifndef MSVCRT_LCONV_DEFINED
 #define MSVCRT_LCONV_DEFINED
-struct MSVCRT(lconv)
+struct lconv
 {
     char* decimal_point;
     char* thousands_sep;
@@ -88,12 +69,12 @@
 extern "C" {
 #endif
 
-char*       MSVCRT(setlocale)(int,const char*);
-struct MSVCRT(lconv)* MSVCRT(localeconv)(void);
+char*       setlocale(int,const char*);
+struct lconv* localeconv(void);
 
 #ifndef MSVCRT_WLOCALE_DEFINED
 #define MSVCRT_WLOCALE_DEFINED
-MSVCRT(wchar_t)* _wsetlocale(int,const MSVCRT(wchar_t)*);
+wchar_t* _wsetlocale(int,const wchar_t*);
 #endif /* MSVCRT_WLOCALE_DEFINED */
 
 #ifdef __cplusplus
Index: include/msvcrt/malloc.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/malloc.h,v
retrieving revision 1.7
diff -u -r1.7 malloc.h
--- include/msvcrt/malloc.h	18 Jul 2003 22:57:15 -0000	1.7
+++ include/msvcrt/malloc.h	16 Jun 2004 05:54:16 -0000
@@ -23,14 +23,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 /* heap function constants */
 #define _HEAPEMPTY    -1
 #define _HEAPOK       -2
@@ -44,7 +36,7 @@
 
 
 #ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
+typedef unsigned int size_t;
 #define MSVCRT_SIZE_T_DEFINED
 #endif
 
@@ -53,7 +45,7 @@
 typedef struct _heapinfo
 {
   int*           _pentry;
-  MSVCRT(size_t) _size;
+  size_t _size;
   int            _useflag;
 } _HEAPINFO;
 #endif /* MSVCRT_HEAPINFO_DEFINED */
@@ -62,19 +54,19 @@
 extern "C" {
 #endif
 
-void*       _expand(void*,MSVCRT(size_t));
-int         _heapadd(void*,MSVCRT(size_t));
+void*       _expand(void*,size_t);
+int         _heapadd(void*,size_t);
 int         _heapchk(void);
 int         _heapmin(void);
 int         _heapset(unsigned int);
-MSVCRT(size_t) _heapused(MSVCRT(size_t)*,MSVCRT(size_t)*);
+size_t _heapused(size_t*,size_t*);
 int         _heapwalk(_HEAPINFO*);
-MSVCRT(size_t) _msize(void*);
+size_t _msize(void*);
 
-void*       MSVCRT(calloc)(MSVCRT(size_t),MSVCRT(size_t));
-void        MSVCRT(free)(void*);
-void*       MSVCRT(malloc)(MSVCRT(size_t));
-void*       MSVCRT(realloc)(void*,MSVCRT(size_t));
+void*       calloc(size_t,size_t);
+void        free(void*);
+void*       malloc(size_t);
+void*       realloc(void*,size_t);
 
 #ifdef __cplusplus
 }
Index: include/msvcrt/math.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/math.h,v
retrieving revision 1.3
diff -u -r1.3 math.h
--- include/msvcrt/math.h	9 Apr 2004 19:02:45 -0000	1.3
+++ include/msvcrt/math.h	16 Jun 2004 05:54:16 -0000
@@ -12,14 +12,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -33,7 +25,7 @@
 
 #ifndef MSVCRT_EXCEPTION_DEFINED
 #define MSVCRT_EXCEPTION_DEFINED
-struct MSVCRT(_exception)
+struct _exception
 {
   int     type;
   char    *name;
@@ -45,7 +37,7 @@
 
 #ifndef MSVCRT_COMPLEX_DEFINED
 #define MSVCRT_COMPLEX_DEFINED
-struct MSVCRT(_complex)
+struct _complex
 {
   double x;      /* Real part */
   double y;      /* Imaginary part */
@@ -83,8 +75,8 @@
 double y1(double);
 double yn(int, double);
 
-int MSVCRT(_matherr)(struct MSVCRT(_exception)*);
-double MSVCRT(_cabs)(struct MSVCRT(_complex));
+int _matherr(struct _exception*);
+double _cabs(struct _complex);
 
 #ifndef HUGE_VAL
 #  if defined(__GNUC__) && (__GNUC__ >= 3)
Index: include/msvcrt/mbstring.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/mbstring.h,v
retrieving revision 1.4
diff -u -r1.4 mbstring.h
--- include/msvcrt/mbstring.h	18 Jul 2003 22:57:15 -0000	1.4
+++ include/msvcrt/mbstring.h	16 Jun 2004 05:54:16 -0000
@@ -23,16 +23,8 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
+typedef unsigned int size_t;
 #define MSVCRT_SIZE_T_DEFINED
 #endif
 
@@ -67,52 +59,52 @@
 void        _mbccpy(unsigned char*,const unsigned char*);
 unsigned int _mbcjistojms(unsigned int);
 unsigned int _mbcjmstojis(unsigned int);
-MSVCRT(size_t) _mbclen(const unsigned char*);
+size_t _mbclen(const unsigned char*);
 unsigned int _mbctohira(unsigned int);
 unsigned int _mbctokata(unsigned int);
 unsigned int _mbctolower(unsigned int);
 unsigned int _mbctombb(unsigned int);
 unsigned int _mbctoupper(unsigned int);
-int         _mbsbtype(const unsigned char*,MSVCRT(size_t));
+int         _mbsbtype(const unsigned char*,size_t);
 unsigned char* _mbscat(unsigned char*,const unsigned char*);
 unsigned char* _mbschr(const unsigned char*,unsigned int);
 int         _mbscmp(const unsigned char*,const unsigned char*);
 int         _mbscoll(const unsigned char*,const unsigned char*);
 unsigned char* _mbscpy(unsigned char*,const unsigned char*);
-MSVCRT(size_t) _mbscspn(const unsigned char*,const unsigned char*);
+size_t _mbscspn(const unsigned char*,const unsigned char*);
 unsigned char* _mbsdec(const unsigned char*,const unsigned char*);
 unsigned char* _mbsdup(const unsigned char*);
 int         _mbsicmp(const unsigned char*,const unsigned char*);
 int         _mbsicoll(const unsigned char*,const unsigned char*);
 unsigned char* _mbsinc(const unsigned char*);
-MSVCRT(size_t) _mbslen(const unsigned char*);
+size_t _mbslen(const unsigned char*);
 unsigned char* _mbslwr(unsigned char*);
-unsigned char* _mbsnbcat(unsigned char*,const unsigned char*,MSVCRT(size_t));
-int         _mbsnbcmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-int         _mbsnbcoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-MSVCRT(size_t) _mbsnbcnt(const unsigned char*,MSVCRT(size_t));
+unsigned char* _mbsnbcat(unsigned char*,const unsigned char*,size_t);
+int         _mbsnbcmp(const unsigned char*,const unsigned char*,size_t);
+int         _mbsnbcoll(const unsigned char*,const unsigned char*,size_t);
+size_t _mbsnbcnt(const unsigned char*,size_t);
 unsigned char* _mbsnbcpy(unsigned char*,const unsigned char*
-,MSVCRT(size_t));
-int         _mbsnbicmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-int         _mbsnbicoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-unsigned char* _mbsnbset(unsigned char*,unsigned int,MSVCRT(size_t))
+,size_t);
+int         _mbsnbicmp(const unsigned char*,const unsigned char*,size_t);
+int         _mbsnbicoll(const unsigned char*,const unsigned char*,size_t);
+unsigned char* _mbsnbset(unsigned char*,unsigned int,size_t)
 ;
 unsigned char* _mbsncat(unsigned char*,const unsigned char*,
- MSVCRT(size_t));
-MSVCRT(size_t) _mbsnccnt(const unsigned char*,MSVCRT(size_t));
-int         _mbsncmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-int         _mbsncoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-unsigned char* _mbsncpy(unsigned char*,const unsigned char*,MSVCRT(size_t));
+ size_t);
+size_t _mbsnccnt(const unsigned char*,size_t);
+int         _mbsncmp(const unsigned char*,const unsigned char*,size_t);
+int         _mbsncoll(const unsigned char*,const unsigned char*,size_t);
+unsigned char* _mbsncpy(unsigned char*,const unsigned char*,size_t);
 unsigned int _mbsnextc (const unsigned char*);
-int         _mbsnicmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-int         _mbsnicoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-unsigned char* _mbsninc(const unsigned char*,MSVCRT(size_t));
-unsigned char* _mbsnset(unsigned char*,unsigned int,MSVCRT(size_t));
+int         _mbsnicmp(const unsigned char*,const unsigned char*,size_t);
+int         _mbsnicoll(const unsigned char*,const unsigned char*,size_t);
+unsigned char* _mbsninc(const unsigned char*,size_t);
+unsigned char* _mbsnset(unsigned char*,unsigned int,size_t);
 unsigned char* _mbspbrk(const unsigned char*,const unsigned char*);
 unsigned char* _mbsrchr(const unsigned char*,unsigned int);
 unsigned char* _mbsrev(unsigned char*);
 unsigned char* _mbsset(unsigned char*,unsigned int);
-MSVCRT(size_t) _mbsspn(const unsigned char*,const unsigned char*);
+size_t _mbsspn(const unsigned char*,const unsigned char*);
 unsigned char* _mbsspnp(const unsigned char*,const unsigned char*);
 unsigned char* _mbsstr(const unsigned char*,const unsigned char*);
 unsigned char* _mbstok(unsigned char*,const unsigned char*);
Index: include/msvcrt/process.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/process.h,v
retrieving revision 1.10
diff -u -r1.10 process.h
--- include/msvcrt/process.h	18 Jul 2003 22:57:15 -0000	1.10
+++ include/msvcrt/process.h	16 Jun 2004 05:54:16 -0000
@@ -11,18 +11,10 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -80,32 +72,32 @@
 int         _spawnvp(int,const char*,const char* const *);
 int         _spawnvpe(int,const char*,const char* const *,const char* const *);
 
-void        MSVCRT(_c_exit)(void);
-void        MSVCRT(_cexit)(void);
-void        MSVCRT(_exit)(int);
-void        MSVCRT(abort)(void);
-void        MSVCRT(exit)(int);
-int         MSVCRT(system)(const char*);
+void        _c_exit(void);
+void        _cexit(void);
+void        _exit(int);
+void        abort(void);
+void        exit(int);
+int         system(const char*);
 
 #ifndef MSVCRT_WPROCESS_DEFINED
 #define MSVCRT_WPROCESS_DEFINED
-int         _wexecl(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexecle(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexeclp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexeclpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexecv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wexecve(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wexecvp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wexecvpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wspawnl(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnle(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnlp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnlpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnv(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wspawnve(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wspawnvp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wspawnvpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wsystem(const MSVCRT(wchar_t)*);
+int         _wexecl(const wchar_t*,const wchar_t*,...);
+int         _wexecle(const wchar_t*,const wchar_t*,...);
+int         _wexeclp(const wchar_t*,const wchar_t*,...);
+int         _wexeclpe(const wchar_t*,const wchar_t*,...);
+int         _wexecv(const wchar_t*,const wchar_t* const *);
+int         _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wexecvp(const wchar_t*,const wchar_t* const *);
+int         _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wspawnl(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnle(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnlp(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnlpe(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnv(int,const wchar_t*,const wchar_t* const *);
+int         _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wspawnvp(int,const wchar_t*,const wchar_t* const *);
+int         _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wsystem(const wchar_t*);
 #endif /* MSVCRT_WPROCESS_DEFINED */
 
 #ifdef __cplusplus
Index: include/msvcrt/search.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/search.h,v
retrieving revision 1.7
diff -u -r1.7 search.h
--- include/msvcrt/search.h	18 Jul 2003 22:57:15 -0000	1.7
+++ include/msvcrt/search.h	16 Jun 2004 05:54:16 -0000
@@ -23,16 +23,8 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
+typedef unsigned int size_t;
 #define MSVCRT_SIZE_T_DEFINED
 #endif
 
@@ -45,9 +37,9 @@
                    int (*)(const void*,const void*));
 void*       _lsearch(const void*,void*,unsigned int*,unsigned int,
                      int (*)(const void*,const void*));
-void*       MSVCRT(bsearch)(const void*,const void*,MSVCRT(size_t),MSVCRT(size_t),
+void*       bsearch(const void*,const void*,size_t,size_t,
                             int (*)(const void*,const void*));
-void        MSVCRT(qsort)(void*,MSVCRT(size_t),MSVCRT(size_t),
+void        qsort(void*,size_t,size_t,
                           int (*)(const void*,const void*));
 
 #ifdef __cplusplus
Index: include/msvcrt/setjmp.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/setjmp.h,v
retrieving revision 1.5
diff -u -r1.5 setjmp.h
--- include/msvcrt/setjmp.h	18 Jul 2003 22:57:15 -0000	1.5
+++ include/msvcrt/setjmp.h	16 Jun 2004 05:54:16 -0000
@@ -23,15 +23,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-
 #ifdef __i386__
 
 typedef struct __JUMP_BUFFER
@@ -52,23 +43,17 @@
 
 #endif /* __i386__ */
 
-#ifndef USE_MSVCRT_PREFIX
 #define _JBLEN                     16
 #define _JBTYPE                    int
 typedef _JBTYPE                    jmp_buf[_JBLEN];
-#else
-#define MSVCRT__JBLEN              16
-#define MSVCRT__JBTYPE             int
-typedef MSVCRT__JBTYPE             MSVCRT_jmp_buf[MSVCRT__JBLEN];
-#endif
 
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-int         MSVCRT(_setjmp)(MSVCRT(jmp_buf));
-int         MSVCRT(longjmp)(MSVCRT(jmp_buf),int);
+int         _setjmp(jmp_buf);
+int         longjmp(jmp_buf,int);
 
 #ifdef __cplusplus
 }
Index: include/msvcrt/stddef.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/stddef.h,v
retrieving revision 1.7
diff -u -r1.7 stddef.h
--- include/msvcrt/stddef.h	18 Jul 2003 22:57:15 -0000	1.7
+++ include/msvcrt/stddef.h	16 Jun 2004 05:54:16 -0000
@@ -23,18 +23,10 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -44,7 +36,7 @@
 #endif
 
 #ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
+typedef unsigned int size_t;
 #define MSVCRT_SIZE_T_DEFINED
 #endif
 
Index: include/msvcrt/stdio.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/stdio.h,v
retrieving revision 1.19
diff -u -r1.19 stdio.h
--- include/msvcrt/stdio.h	12 May 2004 00:12:26 -0000	1.19
+++ include/msvcrt/stdio.h	16 Jun 2004 05:54:16 -0000
@@ -15,16 +15,7 @@
 #include <stdarg.h>
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 /* file._flag flags */
-#ifndef USE_MSVCRT_PREFIX
 #define _IOREAD          0x0001
 #define _IOWRT           0x0002
 #define _IOMYBUF         0x0008
@@ -32,15 +23,6 @@
 #define _IOERR           0x0020
 #define _IOSTRG          0x0040
 #define _IORW            0x0080
-#else
-#define MSVCRT__IOREAD   0x0001
-#define MSVCRT__IOWRT    0x0002
-#define MSVCRT__IOMYBUF  0x0008
-#define MSVCRT__IOEOF    0x0010
-#define MSVCRT__IOERR    0x0020
-#define MSVCRT__IOSTRG   0x0040
-#define MSVCRT__IORW     0x0080
-#endif /* USE_MSVCRT_PREFIX */
 
 #ifndef NULL
 #ifdef  __cplusplus
@@ -50,8 +32,6 @@
 #endif
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
-
 #define STDIN_FILENO  0
 #define STDOUT_FILENO 1
 #define STDERR_FILENO 2
@@ -75,29 +55,9 @@
 #define SEEK_END  2
 #endif
 
-#else
-
-#define MSVCRT_STDIN_FILENO  0
-#define MSVCRT_STDOUT_FILENO 1
-#define MSVCRT_STDERR_FILENO 2
-
-/* more file._flag flags, but these conflict with Unix */
-#define MSVCRT__IOFBF    0x0000
-#define MSVCRT__IONBF    0x0004
-#define MSVCRT__IOLBF    0x0040
-
-#define MSVCRT_FILENAME_MAX 260
-#define MSVCRT_TMP_MAX   0x7fff
-
-#define MSVCRT_EOF       (-1)
-
-#define MSVCRT_BUFSIZ    512
-
-#endif /* USE_MSVCRT_PREFIX */
-
 #ifndef MSVCRT_FILE_DEFINED
 #define MSVCRT_FILE_DEFINED
-typedef struct MSVCRT(_iobuf)
+typedef struct _iobuf
 {
   char* _ptr;
   int   _cnt;
@@ -107,29 +67,29 @@
   int   _charbuf;
   int   _bufsiz;
   char* _tmpfname;
-} MSVCRT(FILE);
+} FILE;
 #endif  /* MSVCRT_FILE_DEFINED */
 
 #ifndef MSVCRT_FPOS_T_DEFINED
-typedef long MSVCRT(fpos_t);
+typedef long fpos_t;
 #define MSVCRT_FPOS_T_DEFINED
 #endif
 
 #ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
+typedef unsigned int size_t;
 #define MSVCRT_SIZE_T_DEFINED
 #endif
 
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
 #ifndef _WCTYPE_T_DEFINED
-typedef unsigned short  MSVCRT(wint_t);
-typedef unsigned short  MSVCRT(wctype_t);
+typedef unsigned short  wint_t;
+typedef unsigned short  wctype_t;
 #define _WCTYPE_T_DEFINED
 #endif
 
@@ -138,124 +98,118 @@
 #endif
 
 #ifndef MSVCRT_STDIO_DEFINED
-MSVCRT(FILE)*        MSVCRT(__p__iob)(void);
+FILE*        __p__iob(void);
 #define _iob               (__p__iob())
 #endif /* MSVCRT_STDIO_DEFINED */
 
-#ifndef USE_MSVCRT_PREFIX
 #define stdin              (_iob+STDIN_FILENO)
 #define stdout             (_iob+STDOUT_FILENO)
 #define stderr             (_iob+STDERR_FILENO)
-#else
-#define MSVCRT_stdin       (MSVCRT__iob+MSVCRT_STDIN_FILENO)
-#define MSVCRT_stdout      (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
-#define MSVCRT_stderr      (MSVCRT__iob+MSVCRT_STDERR_FILENO)
-#endif /* USE_MSVCRT_PREFIX */
 
 #ifndef MSVCRT_STDIO_DEFINED
 #define MSVCRT_STDIO_DEFINED
-int         MSVCRT(_fcloseall)(void);
-MSVCRT(FILE)* MSVCRT(_fdopen)(int,const char*);
+int         _fcloseall(void);
+FILE* _fdopen(int,const char*);
 int         _fgetchar(void);
-int         MSVCRT(_filbuf)(MSVCRT(FILE*));
-int         MSVCRT(_fileno)(MSVCRT(FILE)*);
-int         MSVCRT(_flsbuf)(int,MSVCRT(FILE)*);
+int         _filbuf(FILE*);
+int         _fileno(FILE*);
+int         _flsbuf(int,FILE*);
 int         _flushall(void);
 int         _fputchar(int);
-MSVCRT(FILE)* _fsopen(const char*,const char*,int);
+FILE* _fsopen(const char*,const char*,int);
 int         _getmaxstdio(void);
-int         MSVCRT(_getw)(MSVCRT(FILE)*);
-int         MSVCRT(_pclose)(MSVCRT(FILE)*);
-MSVCRT(FILE)* MSVCRT(_popen)(const char*,const char*);
-int         MSVCRT(_putw)(int,MSVCRT(FILE)*);
+int         _getw(FILE*);
+int         _pclose(FILE*);
+FILE* _popen(const char*,const char*);
+int         _putw(int,FILE*);
 int         _rmtmp(void);
 int         _setmaxstdio(int);
-int         _snprintf(char*,MSVCRT(size_t),const char*,...);
+int         _snprintf(char*,size_t,const char*,...);
 char*       _tempnam(const char*,const char*);
 int         _unlink(const char*);
-int         _vsnprintf(char*,MSVCRT(size_t),const char*,va_list);
+int         _vsnprintf(char*,size_t,const char*,va_list);
 
-void        MSVCRT(clearerr)(MSVCRT(FILE)*);
-int         MSVCRT(fclose)(MSVCRT(FILE)*);
-int         MSVCRT(feof)(MSVCRT(FILE)*);
-int         MSVCRT(ferror)(MSVCRT(FILE)*);
-int         MSVCRT(fflush)(MSVCRT(FILE)*);
-int         MSVCRT(fgetc)(MSVCRT(FILE)*);
-int         MSVCRT(fgetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
-char*       MSVCRT(fgets)(char*,int,MSVCRT(FILE)*);
-MSVCRT(FILE)* MSVCRT(fopen)(const char*,const char*);
-int         MSVCRT(fprintf)(MSVCRT(FILE)*,const char*,...);
-int         MSVCRT(fputc)(int,MSVCRT(FILE)*);
-int         MSVCRT(fputs)(const char*,MSVCRT(FILE)*);
-MSVCRT(size_t) MSVCRT(fread)(void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
-MSVCRT(FILE)* MSVCRT(freopen)(const char*,const char*,MSVCRT(FILE)*);
-int         MSVCRT(fscanf)(MSVCRT(FILE)*,const char*,...);
-int         MSVCRT(fseek)(MSVCRT(FILE)*,long,int);
-int         MSVCRT(fsetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
-long        MSVCRT(ftell)(MSVCRT(FILE)*);
-MSVCRT(size_t) MSVCRT(fwrite)(const void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
-int         MSVCRT(getc)(MSVCRT(FILE)*);
-int         MSVCRT(getchar)(void);
-char*       MSVCRT(gets)(char*);
-void        MSVCRT(perror)(const char*);
-int         MSVCRT(printf)(const char*,...);
-int         MSVCRT(putc)(int,MSVCRT(FILE)*);
-int         MSVCRT(putchar)(int);
-int         MSVCRT(puts)(const char*);
-int         MSVCRT(remove)(const char*);
-int         MSVCRT(rename)(const char*,const char*);
-void        MSVCRT(rewind)(MSVCRT(FILE)*);
-int         MSVCRT(scanf)(const char*,...);
-void        MSVCRT(setbuf)(MSVCRT(FILE)*,char*);
-int         MSVCRT(setvbuf)(MSVCRT(FILE)*,char*,int,MSVCRT(size_t));
-int         MSVCRT(sprintf)(char*,const char*,...);
-int         MSVCRT(sscanf)(const char*,const char*,...);
-MSVCRT(FILE)* MSVCRT(tmpfile)(void);
-char*       MSVCRT(tmpnam)(char*);
-int         MSVCRT(ungetc)(int,MSVCRT(FILE)*);
-int         MSVCRT(vfprintf)(MSVCRT(FILE)*,const char*,va_list);
-int         MSVCRT(vprintf)(const char*,va_list);
-int         MSVCRT(vsprintf)(char*,const char*,va_list);
+void        clearerr(FILE*);
+int         fclose(FILE*);
+int         feof(FILE*);
+int         ferror(FILE*);
+int         fflush(FILE*);
+int         fgetc(FILE*);
+int         fgetpos(FILE*,fpos_t*);
+char*       fgets(char*,int,FILE*);
+FILE* fopen(const char*,const char*);
+int         fprintf(FILE*,const char*,...);
+int         fputc(int,FILE*);
+int         fputs(const char*,FILE*);
+size_t fread(void*,size_t,size_t,FILE*);
+FILE* freopen(const char*,const char*,FILE*);
+int         fscanf(FILE*,const char*,...);
+int         fseek(FILE*,long,int);
+int         fsetpos(FILE*,fpos_t*);
+long        ftell(FILE*);
+size_t fwrite(const void*,size_t,size_t,FILE*);
+int         getc(FILE*);
+int         getchar(void);
+char*       gets(char*);
+void        perror(const char*);
+int         printf(const char*,...);
+int         putc(int,FILE*);
+int         putchar(int);
+int         puts(const char*);
+int         remove(const char*);
+int         rename(const char*,const char*);
+void        rewind(FILE*);
+int         scanf(const char*,...);
+void        setbuf(FILE*,char*);
+int         setvbuf(FILE*,char*,int,size_t);
+int         sprintf(char*,const char*,...);
+int         sscanf(const char*,const char*,...);
+FILE* tmpfile(void);
+char*       tmpnam(char*);
+int         ungetc(int,FILE*);
+int         vfprintf(FILE*,const char*,va_list);
+int         vprintf(const char*,va_list);
+int         vsprintf(char*,const char*,va_list);
 
 #ifndef MSVCRT_WSTDIO_DEFINED
 #define MSVCRT_WSTDIO_DEFINED
-MSVCRT(wint_t)  _fgetwchar(void);
-MSVCRT(wint_t)  _fputwchar(MSVCRT(wint_t));
-MSVCRT(wchar_t)*_getws(MSVCRT(wchar_t)*);
-int             _putws(const MSVCRT(wchar_t)*);
-int             _snwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,...);
-int             _vsnwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,va_list);
-MSVCRT(FILE)*   MSVCRT(_wfdopen)(int,const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   MSVCRT(_wfopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   MSVCRT(_wfreopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-MSVCRT(FILE)*   MSVCRT(_wfsopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,int);
-void            _wperror(const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   MSVCRT(_wpopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             _wremove(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wtempnam(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wtmpnam(MSVCRT(wchar_t)*);
-
-MSVCRT(wint_t)  MSVCRT(fgetwc)(MSVCRT(FILE)*);
-MSVCRT(wchar_t)*MSVCRT(fgetws)(MSVCRT(wchar_t)*,int,MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(fputwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-int             MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-int             MSVCRT(fwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
-int             MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-int             MSVCRT(fwscanf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
-MSVCRT(wint_t)  MSVCRT(getwc)(MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(getwchar)(void);
-MSVCRT(wchar_t)*MSVCRT(getws)(MSVCRT(wchar_t)*);
-MSVCRT(wint_t)  MSVCRT(putwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(putwchar)(MSVCRT(wint_t));
-int             MSVCRT(putws)(const MSVCRT(wchar_t)*);
-int             MSVCRT(swprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int             MSVCRT(swscanf)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-MSVCRT(wint_t)  MSVCRT(ungetwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-int             MSVCRT(vfwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(vswprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(vwprintf)(const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(wprintf)(const MSVCRT(wchar_t)*,...);
-int             MSVCRT(wscanf)(const MSVCRT(wchar_t)*,...);
+wint_t  _fgetwchar(void);
+wint_t  _fputwchar(wint_t);
+wchar_t*_getws(wchar_t*);
+int             _putws(const wchar_t*);
+int             _snwprintf(wchar_t*,size_t,const wchar_t*,...);
+int             _vsnwprintf(wchar_t*,size_t,const wchar_t*,va_list);
+FILE*   _wfdopen(int,const wchar_t*);
+FILE*   _wfopen(const wchar_t*,const wchar_t*);
+FILE*   _wfreopen(const wchar_t*,const wchar_t*,FILE*);
+FILE*   _wfsopen(const wchar_t*,const wchar_t*,int);
+void            _wperror(const wchar_t*);
+FILE*   _wpopen(const wchar_t*,const wchar_t*);
+int             _wremove(const wchar_t*);
+wchar_t*_wtempnam(const wchar_t*,const wchar_t*);
+wchar_t*_wtmpnam(wchar_t*);
+
+wint_t  fgetwc(FILE*);
+wchar_t*fgetws(wchar_t*,int,FILE*);
+wint_t  fputwc(wint_t,FILE*);
+int             fputws(const wchar_t*,FILE*);
+int             fwprintf(FILE*,const wchar_t*,...);
+int             fputws(const wchar_t*,FILE*);
+int             fwscanf(FILE*,const wchar_t*,...);
+wint_t  getwc(FILE*);
+wint_t  getwchar(void);
+wchar_t*getws(wchar_t*);
+wint_t  putwc(wint_t,FILE*);
+wint_t  putwchar(wint_t);
+int             putws(const wchar_t*);
+int             swprintf(wchar_t*,const wchar_t*,...);
+int             swscanf(const wchar_t*,const wchar_t*,...);
+wint_t  ungetwc(wint_t,FILE*);
+int             vfwprintf(FILE*,const wchar_t*,va_list);
+int             vswprintf(wchar_t*,const wchar_t*,va_list);
+int             vwprintf(const wchar_t*,va_list);
+int             wprintf(const wchar_t*,...);
+int             wscanf(const wchar_t*,...);
 #endif /* MSVCRT_WSTDIO_DEFINED */
 
 #endif /* MSVCRT_STDIO_DEFINED */
@@ -266,12 +220,12 @@
 
 
 #ifndef USE_MSVCRT_PREFIX
-static inline MSVCRT(FILE)* fdopen(int fd, const char *mode) { return _fdopen(fd, mode); }
+static inline FILE* fdopen(int fd, const char *mode) { return _fdopen(fd, mode); }
 static inline int fgetchar(void) { return _fgetchar(); }
-static inline int fileno(MSVCRT(FILE)* file) { return _fileno(file); }
+static inline int fileno(FILE* file) { return _fileno(file); }
 static inline int fputchar(int c) { return _fputchar(c); }
-static inline int pclose(MSVCRT(FILE)* file) { return _pclose(file); }
-static inline MSVCRT(FILE)* popen(const char* command, const char* mode) { return _popen(command, mode); }
+static inline int pclose(FILE* file) { return _pclose(file); }
+static inline FILE* popen(const char* command, const char* mode) { return _popen(command, mode); }
 static inline char* tempnam(const char *dir, const char *prefix) { return _tempnam(dir, prefix); }
 #ifndef MSVCRT_UNLINK_DEFINED
 static inline int unlink(const char* path) { return _unlink(path); }
@@ -279,11 +233,11 @@
 #endif
 static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args) { return _vsnprintf(buffer,size,format,args); }
 
-static inline MSVCRT(wint_t) fgetwchar(void) { return _fgetwchar(); }
-static inline MSVCRT(wint_t) fputwchar(MSVCRT(wint_t) wc) { return _fputwchar(wc); }
-static inline int getw(MSVCRT(FILE)* file) { return _getw(file); }
-static inline int putw(int val, MSVCRT(FILE)* file) { return _putw(val, file); }
-static inline MSVCRT(FILE)* wpopen(const MSVCRT(wchar_t)* command,const MSVCRT(wchar_t)* mode) { return _wpopen(command, mode); }
+static inline wint_t fgetwchar(void) { return _fgetwchar(); }
+static inline wint_t fputwchar(wint_t wc) { return _fputwchar(wc); }
+static inline int getw(FILE* file) { return _getw(file); }
+static inline int putw(int val, FILE* file) { return _putw(val, file); }
+static inline FILE* wpopen(const wchar_t* command,const wchar_t* mode) { return _wpopen(command, mode); }
 #endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_STDIO_H */
Index: include/msvcrt/stdlib.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/stdlib.h,v
retrieving revision 1.16
diff -u -r1.16 stdlib.h
--- include/msvcrt/stdlib.h	16 Mar 2004 19:17:11 -0000	1.16
+++ include/msvcrt/stdlib.h	16 Jun 2004 05:54:16 -0000
@@ -11,14 +11,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef NULL
 #ifdef __cplusplus
 #define NULL  0
@@ -30,7 +22,7 @@
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -40,13 +32,9 @@
 # endif
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
 #define EXIT_SUCCESS        0
 #define EXIT_FAILURE        -1
 #define RAND_MAX            0x7FFF
-#else
-#define MSVCRT_RAND_MAX     0x7FFF
-#endif /* USE_MSVCRT_PREFIX */
 
 #ifndef _MAX_PATH
 #define _MAX_DRIVE          3
@@ -57,18 +45,18 @@
 #endif
 
 
-typedef struct MSVCRT(_div_t) {
+typedef struct _div_t {
     int quot;
     int rem;
-} MSVCRT(div_t);
+} div_t;
 
-typedef struct MSVCRT(_ldiv_t) {
+typedef struct _ldiv_t {
     long quot;
     long rem;
-} MSVCRT(ldiv_t);
+} ldiv_t;
 
 #ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
+typedef unsigned int size_t;
 #define MSVCRT_SIZE_T_DEFINED
 #endif
 
@@ -101,17 +89,16 @@
 
 extern int*                  __p___argc(void);
 extern char***               __p___argv(void);
-extern MSVCRT(wchar_t)***    __p___wargv(void);
+extern wchar_t***    __p___wargv(void);
 extern char***               __p__environ(void);
-extern MSVCRT(wchar_t)***    __p__wenviron(void);
+extern wchar_t***    __p__wenviron(void);
 extern int*                  __p___mb_cur_max(void);
-extern unsigned long*        MSVCRT(__doserrno)(void);
+extern unsigned long*        __doserrno(void);
 extern unsigned int*         __p__fmode(void);
 /* FIXME: We need functions to access these:
  * int _sys_nerr;
  * char** _sys_errlist;
  */
-#ifndef USE_MSVCRT_PREFIX
 #define __argc             (*__p___argc())
 #define __argv             (*__p___argv())
 #define __wargv            (*__p___wargv())
@@ -120,18 +107,13 @@
 #define __mb_cur_max       (*__p___mb_cur_max())
 #define _doserrno          (*__doserrno())
 #define _fmode             (*_fmode)
-#endif /* USE_MSVCRT_PREFIX */
 
 
-extern int*           MSVCRT(_errno)(void);
-#ifndef USE_MSVCRT_PREFIX
-# define errno        (*_errno())
-#else
-# define MSVCRT_errno (*MSVCRT__errno())
-#endif
+extern int*           _errno(void);
+#define errno        (*_errno())
 
 
-typedef int (*MSVCRT(_onexit_t))(void);
+typedef int (*_onexit_t)(void);
 
 
 __int64     _atoi64(const char*);
@@ -139,7 +121,7 @@
 void        _beep(unsigned int,unsigned int);
 char*       _ecvt(double,int,int*,int*);
 char*       _fcvt(double,int,int*,int*);
-char*       _fullpath(char*,const char*,MSVCRT(size_t));
+char*       _fullpath(char*,const char*,size_t);
 char*       _gcvt(double,int,char*);
 char*       _i64toa(__int64,char*,int);
 char*       _itoa(int,char*,int);
@@ -147,8 +129,8 @@
 unsigned long _lrotl(unsigned long,int);
 unsigned long _lrotr(unsigned long,int);
 void        _makepath(char*,const char*,const char*,const char*,const char*);
-MSVCRT(size_t) _mbstrlen(const char*);
-MSVCRT(_onexit_t) MSVCRT(_onexit)(MSVCRT(_onexit_t));
+size_t _mbstrlen(const char*);
+_onexit_t _onexit(_onexit_t);
 int         _putenv(const char*);
 unsigned int _rotl(unsigned int,int);
 unsigned int _rotr(unsigned int,int);
@@ -158,67 +140,67 @@
 void        _sleep(unsigned long);
 void        _splitpath(const char*,char*,char*,char*,char*);
 long double _strtold(const char*,char**);
-void        MSVCRT(_swab)(char*,char*,int);
+void        _swab(char*,char*,int);
 char*       _ui64toa(unsigned __int64,char*,int);
 char*       _ultoa(unsigned long,char*,int);
 
-void        MSVCRT(_exit)(int);
-void        MSVCRT(abort)();
-int         MSVCRT(abs)(int);
-int         MSVCRT(atexit)(void (*)(void));
-double      MSVCRT(atof)(const char*);
-int         MSVCRT(atoi)(const char*);
-long        MSVCRT(atol)(const char*);
-void*       MSVCRT(calloc)(MSVCRT(size_t),MSVCRT(size_t));
+void        _exit(int);
+void        abort();
+int         abs(int);
+int         atexit(void (*)(void));
+double      atof(const char*);
+int         atoi(const char*);
+long        atol(const char*);
+void*       calloc(size_t,size_t);
 #ifndef __i386__
-MSVCRT(div_t) MSVCRT(div)(int,int);
-MSVCRT(ldiv_t) MSVCRT(ldiv)(long,long);
+div_t div(int,int);
+ldiv_t ldiv(long,long);
 #endif
-void        MSVCRT(exit)(int);
-void        MSVCRT(free)(void*);
-char*       MSVCRT(getenv)(const char*);
-long        MSVCRT(labs)(long);
-void*       MSVCRT(malloc)(MSVCRT(size_t));
-int         MSVCRT(mblen)(const char*,MSVCRT(size_t));
-void        MSVCRT(perror)(const char*);
-int         MSVCRT(rand)(void);
-void*       MSVCRT(realloc)(void*,MSVCRT(size_t));
-void        MSVCRT(srand)(unsigned int);
-double      MSVCRT(strtod)(const char*,char**);
-long        MSVCRT(strtol)(const char*,char**,int);
-unsigned long MSVCRT(strtoul)(const char*,char**,int);
-int         MSVCRT(system)(const char*);
-void*       MSVCRT(bsearch)(const void*,const void*,MSVCRT(size_t),MSVCRT(size_t),
+void        exit(int);
+void        free(void*);
+char*       getenv(const char*);
+long        labs(long);
+void*       malloc(size_t);
+int         mblen(const char*,size_t);
+void        perror(const char*);
+int         rand(void);
+void*       realloc(void*,size_t);
+void        srand(unsigned int);
+double      strtod(const char*,char**);
+long        strtol(const char*,char**,int);
+unsigned long strtoul(const char*,char**,int);
+int         system(const char*);
+void*       bsearch(const void*,const void*,size_t,size_t,
                             int (*)(const void*,const void*));
-void        MSVCRT(qsort)(void*,MSVCRT(size_t),MSVCRT(size_t),
+void        qsort(void*,size_t,size_t,
                           int (*)(const void*,const void*));
 
 #ifndef MSVCRT_WSTDLIB_DEFINED
 #define MSVCRT_WSTDLIB_DEFINED
-MSVCRT(wchar_t)*_itow(int,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_i64tow(__int64,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ltow(long,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ui64tow(unsigned __int64,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ultow(unsigned long,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_wfullpath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*_wgetenv(const MSVCRT(wchar_t)*);
-void            _wmakepath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-void            _wperror(const MSVCRT(wchar_t)*);
-int             _wputenv(const MSVCRT(wchar_t)*);
-void            _wsearchenv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
-void            _wsplitpath(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
-int             _wsystem(const MSVCRT(wchar_t)*);
-int             _wtoi(const MSVCRT(wchar_t)*);
-__int64         _wtoi64(const MSVCRT(wchar_t)*);
-long            _wtol(const MSVCRT(wchar_t)*);
-
-MSVCRT(size_t) MSVCRT(mbstowcs)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
-int            MSVCRT(mbtowc)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
-double         MSVCRT(wcstod)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**);
-long           MSVCRT(wcstol)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
-MSVCRT(size_t) MSVCRT(wcstombs)(char*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-unsigned long  MSVCRT(wcstoul)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
-int            MSVCRT(wctomb)(char*,MSVCRT(wchar_t));
+wchar_t*_itow(int,wchar_t*,int);
+wchar_t*_i64tow(__int64,wchar_t*,int);
+wchar_t*_ltow(long,wchar_t*,int);
+wchar_t*_ui64tow(unsigned __int64,wchar_t*,int);
+wchar_t*_ultow(unsigned long,wchar_t*,int);
+wchar_t*_wfullpath(wchar_t*,const wchar_t*,size_t);
+wchar_t*_wgetenv(const wchar_t*);
+void            _wmakepath(wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*);
+void            _wperror(const wchar_t*);
+int             _wputenv(const wchar_t*);
+void            _wsearchenv(const wchar_t*,const wchar_t*,wchar_t*);
+void            _wsplitpath(const wchar_t*,wchar_t*,wchar_t*,wchar_t*,wchar_t*);
+int             _wsystem(const wchar_t*);
+int             _wtoi(const wchar_t*);
+__int64         _wtoi64(const wchar_t*);
+long            _wtol(const wchar_t*);
+
+size_t mbstowcs(wchar_t*,const char*,size_t);
+int            mbtowc(wchar_t*,const char*,size_t);
+double         wcstod(const wchar_t*,wchar_t**);
+long           wcstol(const wchar_t*,wchar_t**,int);
+size_t wcstombs(char*,const wchar_t*,size_t);
+unsigned long  wcstoul(const wchar_t*,wchar_t**,int);
+int            wctomb(char*,wchar_t);
 #endif /* MSVCRT_WSTDLIB_DEFINED */
 
 #ifdef __cplusplus
Index: include/msvcrt/string.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/string.h,v
retrieving revision 1.9
diff -u -r1.9 string.h
--- include/msvcrt/string.h	16 Mar 2004 19:17:11 -0000	1.9
+++ include/msvcrt/string.h	16 Jun 2004 05:54:16 -0000
@@ -11,23 +11,15 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
 #ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
+typedef unsigned int size_t;
 #define MSVCRT_SIZE_T_DEFINED
 #endif
 
@@ -56,63 +48,63 @@
 int         _stricmp(const char*,const char*);
 int         _stricoll(const char*,const char*);
 char*       _strlwr(char*);
-int         _strnicmp(const char*,const char*,MSVCRT(size_t));
-char*       _strnset(char*,int,MSVCRT(size_t));
+int         _strnicmp(const char*,const char*,size_t);
+char*       _strnset(char*,int,size_t);
 char*       _strrev(char*);
 char*       _strset(char*,int);
 char*       _strupr(char*);
 
-void*       MSVCRT(memchr)(const void*,int,MSVCRT(size_t));
-int         MSVCRT(memcmp)(const void*,const void*,MSVCRT(size_t));
-void*       MSVCRT(memcpy)(void*,const void*,MSVCRT(size_t));
-void*       MSVCRT(memmove)(void*,const void*,MSVCRT(size_t));
-void*       MSVCRT(memset)(void*,int,MSVCRT(size_t));
-char*       MSVCRT(strcat)(char*,const char*);
-char*       MSVCRT(strchr)(const char*,int);
-int         MSVCRT(strcmp)(const char*,const char*);
-int         MSVCRT(strcoll)(const char*,const char*);
-char*       MSVCRT(strcpy)(char*,const char*);
-MSVCRT(size_t) MSVCRT(strcspn)(const char*,const char*);
-char*       MSVCRT(strerror)(int);
-MSVCRT(size_t) MSVCRT(strlen)(const char*);
-char*       MSVCRT(strncat)(char*,const char*,MSVCRT(size_t));
-int         MSVCRT(strncmp)(const char*,const char*,MSVCRT(size_t));
-char*       MSVCRT(strncpy)(char*,const char*,MSVCRT(size_t));
-char*       MSVCRT(strpbrk)(const char*,const char*);
-char*       MSVCRT(strrchr)(const char*,int);
-MSVCRT(size_t) MSVCRT(strspn)(const char*,const char*);
-char*       MSVCRT(strstr)(const char*,const char*);
-char*       MSVCRT(strtok)(char*,const char*);
-MSVCRT(size_t) MSVCRT(strxfrm)(char*,const char*,MSVCRT(size_t));
+void*       memchr(const void*,int,size_t);
+int         memcmp(const void*,const void*,size_t);
+void*       memcpy(void*,const void*,size_t);
+void*       memmove(void*,const void*,size_t);
+void*       memset(void*,int,size_t);
+char*       strcat(char*,const char*);
+char*       strchr(const char*,int);
+int         strcmp(const char*,const char*);
+int         strcoll(const char*,const char*);
+char*       strcpy(char*,const char*);
+size_t strcspn(const char*,const char*);
+char*       strerror(int);
+size_t strlen(const char*);
+char*       strncat(char*,const char*,size_t);
+int         strncmp(const char*,const char*,size_t);
+char*       strncpy(char*,const char*,size_t);
+char*       strpbrk(const char*,const char*);
+char*       strrchr(const char*,int);
+size_t strspn(const char*,const char*);
+char*       strstr(const char*,const char*);
+char*       strtok(char*,const char*);
+size_t strxfrm(char*,const char*,size_t);
 
 #ifndef MSVCRT_WSTRING_DEFINED
 #define MSVCRT_WSTRING_DEFINED
-MSVCRT(wchar_t)*_wcsdup(const MSVCRT(wchar_t)*);
-int             _wcsicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             _wcsicoll(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wcslwr(MSVCRT(wchar_t)*);
-int             _wcsnicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*_wcsnset(MSVCRT(wchar_t)*,MSVCRT(wchar_t),MSVCRT(size_t));
-MSVCRT(wchar_t)*_wcsrev(MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wcsset(MSVCRT(wchar_t)*,MSVCRT(wchar_t));
-MSVCRT(wchar_t)*_wcsupr(MSVCRT(wchar_t)*);
-
-MSVCRT(wchar_t)*MSVCRT(wcscat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcschr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t));
-int             MSVCRT(wcscmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             MSVCRT(wcscoll)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcscpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcscspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcslen)(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsncat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-int             MSVCRT(wcsncmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*MSVCRT(wcsncpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*MSVCRT(wcspbrk)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsrchr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t) wcFor);
-MSVCRT(size_t)  MSVCRT(wcsspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsstr)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcstok)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcsxfrm)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
+wchar_t*_wcsdup(const wchar_t*);
+int             _wcsicmp(const wchar_t*,const wchar_t*);
+int             _wcsicoll(const wchar_t*,const wchar_t*);
+wchar_t*_wcslwr(wchar_t*);
+int             _wcsnicmp(const wchar_t*,const wchar_t*,size_t);
+wchar_t*_wcsnset(wchar_t*,wchar_t,size_t);
+wchar_t*_wcsrev(wchar_t*);
+wchar_t*_wcsset(wchar_t*,wchar_t);
+wchar_t*_wcsupr(wchar_t*);
+
+wchar_t*wcscat(wchar_t*,const wchar_t*);
+wchar_t*wcschr(const wchar_t*,wchar_t);
+int             wcscmp(const wchar_t*,const wchar_t*);
+int             wcscoll(const wchar_t*,const wchar_t*);
+wchar_t*wcscpy(wchar_t*,const wchar_t*);
+size_t  wcscspn(const wchar_t*,const wchar_t*);
+size_t  wcslen(const wchar_t*);
+wchar_t*wcsncat(wchar_t*,const wchar_t*,size_t);
+int             wcsncmp(const wchar_t*,const wchar_t*,size_t);
+wchar_t*wcsncpy(wchar_t*,const wchar_t*,size_t);
+wchar_t*wcspbrk(const wchar_t*,const wchar_t*);
+wchar_t*wcsrchr(const wchar_t*,wchar_t wcFor);
+size_t  wcsspn(const wchar_t*,const wchar_t*);
+wchar_t*wcsstr(const wchar_t*,const wchar_t*);
+wchar_t*wcstok(wchar_t*,const wchar_t*);
+size_t  wcsxfrm(wchar_t*,const wchar_t*,size_t);
 #endif /* MSVCRT_WSTRING_DEFINED */
 
 #ifdef __cplusplus
@@ -121,8 +113,8 @@
 
 
 #ifndef USE_MSVCRT_PREFIX
-static inline void* memccpy(void *s1, const void *s2, int c, MSVCRT(size_t) n) { return _memccpy(s1, s2, c, n); }
-static inline int memicmp(const void* s1, const void* s2, MSVCRT(size_t) len) { return _memicmp(s1, s2, len); }
+static inline void* memccpy(void *s1, const void *s2, int c, size_t n) { return _memccpy(s1, s2, c, n); }
+static inline int memicmp(const void* s1, const void* s2, size_t len) { return _memicmp(s1, s2, len); }
 static inline int strcasecmp(const char* s1, const char* s2) { return _stricmp(s1, s2); }
 static inline int strcmpi(const char* s1, const char* s2) { return _strcmpi(s1, s2); }
 static inline char* strdup(const char* buf) { return _strdup(buf); }
@@ -130,20 +122,20 @@
 static inline int stricoll(const char* s1, const char* s2) { return _stricoll(s1, s2); }
 static inline char* strlwr(char* str) { return _strlwr(str); }
 static inline int strncasecmp(const char *str1, const char *str2, size_t n) { return _strnicmp(str1, str2, n); }
-static inline int strnicmp(const char* s1, const char* s2, MSVCRT(size_t) n) { return _strnicmp(s1, s2, n); }
+static inline int strnicmp(const char* s1, const char* s2, size_t n) { return _strnicmp(s1, s2, n); }
 static inline char* strnset(char* str, int value, unsigned int len) { return _strnset(str, value, len); }
 static inline char* strrev(char* str) { return _strrev(str); }
 static inline char* strset(char* str, int value) { return _strset(str, value); }
 static inline char* strupr(char* str) { return _strupr(str); }
 
-static inline MSVCRT(wchar_t)* wcsdup(const MSVCRT(wchar_t)* str) { return _wcsdup(str); }
-static inline int wcsicoll(const MSVCRT(wchar_t)* str1, const MSVCRT(wchar_t)* str2) { return _wcsicoll(str1, str2); }
-static inline MSVCRT(wchar_t)* wcslwr(MSVCRT(wchar_t)* str) { return _wcslwr(str); }
-static inline int wcsnicmp(const MSVCRT(wchar_t)* str1, const MSVCRT(wchar_t)* str2, MSVCRT(size_t) n) { return _wcsnicmp(str1, str2, n); }
-static inline MSVCRT(wchar_t)* wcsnset(MSVCRT(wchar_t)* str, MSVCRT(wchar_t) c, MSVCRT(size_t) n) { return _wcsnset(str, c, n); }
-static inline MSVCRT(wchar_t)* wcsrev(MSVCRT(wchar_t)* str) { return _wcsrev(str); }
-static inline MSVCRT(wchar_t)* wcsset(MSVCRT(wchar_t)* str, MSVCRT(wchar_t) c) { return _wcsset(str, c); }
-static inline MSVCRT(wchar_t)* wcsupr(MSVCRT(wchar_t)* str) { return _wcsupr(str); }
+static inline wchar_t* wcsdup(const wchar_t* str) { return _wcsdup(str); }
+static inline int wcsicoll(const wchar_t* str1, const wchar_t* str2) { return _wcsicoll(str1, str2); }
+static inline wchar_t* wcslwr(wchar_t* str) { return _wcslwr(str); }
+static inline int wcsnicmp(const wchar_t* str1, const wchar_t* str2, size_t n) { return _wcsnicmp(str1, str2, n); }
+static inline wchar_t* wcsnset(wchar_t* str, wchar_t c, size_t n) { return _wcsnset(str, c, n); }
+static inline wchar_t* wcsrev(wchar_t* str) { return _wcsrev(str); }
+static inline wchar_t* wcsset(wchar_t* str, wchar_t c) { return _wcsset(str, c); }
+static inline wchar_t* wcsupr(wchar_t* str) { return _wcsupr(str); }
 #endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_STRING_H */
Index: include/msvcrt/time.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/time.h,v
retrieving revision 1.7
diff -u -r1.7 time.h
--- include/msvcrt/time.h	16 Mar 2004 19:17:11 -0000	1.7
+++ include/msvcrt/time.h	16 Jun 2004 05:54:16 -0000
@@ -23,33 +23,25 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
 #ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
+typedef unsigned int size_t;
 #define MSVCRT_SIZE_T_DEFINED
 #endif
 
 #ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
+typedef long time_t;
 #define MSVCRT_TIME_T_DEFINED
 #endif
 
 #ifndef MSVCRT_CLOCK_T_DEFINED
-typedef long MSVCRT(clock_t);
+typedef long clock_t;
 #define MSVCRT_CLOCK_T_DEFINED
 #endif
 
@@ -67,7 +59,7 @@
 
 #ifndef MSVCRT_TM_DEFINED
 #define MSVCRT_TM_DEFINED
-struct MSVCRT(tm) {
+struct tm {
     int tm_sec;
     int tm_min;
     int tm_hour;
@@ -87,29 +79,29 @@
 /* FIXME: Must do something for _daylight, _dstbias, _timezone, _tzname */
 
 
-unsigned    _getsystime(struct MSVCRT(tm)*);
-unsigned    _setsystime(struct MSVCRT(tm)*,unsigned);
+unsigned    _getsystime(struct tm*);
+unsigned    _setsystime(struct tm*,unsigned);
 char*       _strdate(char*);
 char*       _strtime(char*);
 void        _tzset(void);
 
-char*       MSVCRT(asctime)(const struct MSVCRT(tm)*);
-MSVCRT(clock_t) MSVCRT(clock)(void);
-char*       MSVCRT(ctime)(const MSVCRT(time_t)*);
-double      MSVCRT(difftime)(MSVCRT(time_t),MSVCRT(time_t));
-struct MSVCRT(tm)* MSVCRT(gmtime)(const MSVCRT(time_t)*);
-struct MSVCRT(tm)* MSVCRT(localtime)(const MSVCRT(time_t)*);
-MSVCRT(time_t) MSVCRT(mktime)(struct MSVCRT(tm)*);
-size_t      MSVCRT(strftime)(char*,size_t,const char*,const struct MSVCRT(tm)*);
-MSVCRT(time_t) MSVCRT(time)(MSVCRT(time_t)*);
+char*       asctime(const struct tm*);
+clock_t clock(void);
+char*       ctime(const time_t*);
+double      difftime(time_t,time_t);
+struct tm* gmtime(const time_t*);
+struct tm* localtime(const time_t*);
+time_t mktime(struct tm*);
+size_t      strftime(char*,size_t,const char*,const struct tm*);
+time_t time(time_t*);
 
 #ifndef MSVCRT_WTIME_DEFINED
 #define MSVCRT_WTIME_DEFINED
-MSVCRT(wchar_t)* MSVCRT(_wasctime)(const struct MSVCRT(tm)*);
-MSVCRT(size_t)  MSVCRT(wcsftime)(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,const struct MSVCRT(tm)*);
-MSVCRT(wchar_t)*_wctime(const MSVCRT(time_t)*);
-MSVCRT(wchar_t)*_wstrdate(MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wstrtime(MSVCRT(wchar_t)*);
+wchar_t* _wasctime(const struct tm*);
+size_t  wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*);
+wchar_t*_wctime(const time_t*);
+wchar_t*_wstrdate(wchar_t*);
+wchar_t*_wstrtime(wchar_t*);
 #endif /* MSVCRT_WTIME_DEFINED */
 
 #ifdef __cplusplus
Index: include/msvcrt/wchar.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/wchar.h,v
retrieving revision 1.8
diff -u -r1.8 wchar.h
--- include/msvcrt/wchar.h	26 Apr 2004 23:31:39 -0000	1.8
+++ include/msvcrt/wchar.h	16 Jun 2004 05:56:01 -0000
@@ -13,14 +13,6 @@
 
 #include <stdarg.h>
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -28,7 +20,7 @@
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -41,18 +33,18 @@
 #endif
 
 #define WCHAR_MIN 0
-#define WCHAR_MAX ((MSVCRT(wchar_t))-1)
+#define WCHAR_MAX ((wchar_t)-1)
 
-typedef int MSVCRT(mbstate_t);
+typedef int mbstate_t;
 
 #ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
+typedef unsigned int size_t;
 #define MSVCRT_SIZE_T_DEFINED
 #endif
 
 #ifndef _WCTYPE_T_DEFINED
-typedef unsigned short  MSVCRT(wint_t);
-typedef unsigned short  MSVCRT(wctype_t);
+typedef unsigned short  wint_t;
+typedef unsigned short  wctype_t;
 #define _WCTYPE_T_DEFINED
 #endif
 
@@ -62,15 +54,9 @@
 # endif
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
-# ifndef WEOF
-#  define WEOF        (wint_t)(0xFFFF)
-# endif
-#else
-# ifndef MSVCRT_WEOF
-#  define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
-# endif
-#endif /* USE_MSVCRT_PREFIX */
+#ifndef WEOF
+#define WEOF        (wint_t)(0xFFFF)
+#endif
 
 #ifndef MSVCRT_FSIZE_T_DEFINED
 typedef unsigned long _fsize_t;
@@ -88,18 +74,18 @@
 #endif
 
 #ifndef MSVCRT_OFF_T_DEFINED
-typedef int MSVCRT(_off_t);
+typedef int _off_t;
 #define MSVCRT_OFF_T_DEFINED
 #endif
 
 #ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
+typedef long time_t;
 #define MSVCRT_TIME_T_DEFINED
 #endif
 
 #ifndef MSVCRT_TM_DEFINED
 #define MSVCRT_TM_DEFINED
-struct MSVCRT(tm) {
+struct tm {
     int tm_sec;
     int tm_min;
     int tm_hour;
@@ -114,7 +100,7 @@
 
 #ifndef MSVCRT_FILE_DEFINED
 #define MSVCRT_FILE_DEFINED
-typedef struct MSVCRT(_iobuf)
+typedef struct _iobuf
 {
   char* _ptr;
   int   _cnt;
@@ -124,28 +110,28 @@
   int   _charbuf;
   int   _bufsiz;
   char* _tmpfname;
-} MSVCRT(FILE);
+} FILE;
 #endif  /* MSVCRT_FILE_DEFINED */
 
 #ifndef MSVCRT_WFINDDATA_T_DEFINED
 #define MSVCRT_WFINDDATA_T_DEFINED
 
-struct MSVCRT(_wfinddata_t) {
+struct _wfinddata_t {
   unsigned attrib;
-  MSVCRT(time_t) time_create;
-  MSVCRT(time_t) time_access;
-  MSVCRT(time_t) time_write;
-  MSVCRT(_fsize_t) size;
-  MSVCRT(wchar_t) name[260];
+  time_t time_create;
+  time_t time_access;
+  time_t time_write;
+  _fsize_t size;
+  wchar_t name[260];
 };
 
-struct MSVCRT(_wfinddatai64_t) {
+struct _wfinddatai64_t {
   unsigned attrib;
-  MSVCRT(time_t) time_create;
-  MSVCRT(time_t) time_access;
-  MSVCRT(time_t) time_write;
+  time_t time_create;
+  time_t time_access;
+  time_t time_write;
   __int64        size;
-  MSVCRT(wchar_t) name[260];
+  wchar_t name[260];
 };
 
 #endif /* MSVCRT_WFINDDATA_T_DEFINED */
@@ -153,46 +139,46 @@
 #ifndef MSVCRT_STAT_DEFINED
 #define MSVCRT_STAT_DEFINED
 
-struct MSVCRT(_stat) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct _stat {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
-  MSVCRT(_off_t) st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  _dev_t st_rdev;
+  _off_t st_size;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
 
-struct MSVCRT(stat) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct stat {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
-  MSVCRT(_off_t) st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  _dev_t st_rdev;
+  _off_t st_size;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
 
-struct MSVCRT(_stati64) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct _stati64 {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
+  _dev_t st_rdev;
   __int64        st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
 #endif /* MSVCRT_STAT_DEFINED */
 
@@ -210,197 +196,197 @@
 
 #ifndef MSVCRT_WCTYPE_DEFINED
 #define MSVCRT_WCTYPE_DEFINED
-int MSVCRT(is_wctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
-int MSVCRT(isleadbyte)(int);
-int MSVCRT(iswalnum)(MSVCRT(wint_t));
-int MSVCRT(iswalpha)(MSVCRT(wint_t));
-int MSVCRT(iswascii)(MSVCRT(wint_t));
-int MSVCRT(iswcntrl)(MSVCRT(wint_t));
-int MSVCRT(iswctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
-int MSVCRT(iswdigit)(MSVCRT(wint_t));
-int MSVCRT(iswgraph)(MSVCRT(wint_t));
-int MSVCRT(iswlower)(MSVCRT(wint_t));
-int MSVCRT(iswprint)(MSVCRT(wint_t));
-int MSVCRT(iswpunct)(MSVCRT(wint_t));
-int MSVCRT(iswspace)(MSVCRT(wint_t));
-int MSVCRT(iswupper)(MSVCRT(wint_t));
-int MSVCRT(iswxdigit)(MSVCRT(wint_t));
-MSVCRT(wchar_t) MSVCRT(towlower)(MSVCRT(wchar_t));
-MSVCRT(wchar_t) MSVCRT(towupper)(MSVCRT(wchar_t));
+int is_wctype(wint_t,wctype_t);
+int isleadbyte(int);
+int iswalnum(wint_t);
+int iswalpha(wint_t);
+int iswascii(wint_t);
+int iswcntrl(wint_t);
+int iswctype(wint_t,wctype_t);
+int iswdigit(wint_t);
+int iswgraph(wint_t);
+int iswlower(wint_t);
+int iswprint(wint_t);
+int iswpunct(wint_t);
+int iswspace(wint_t);
+int iswupper(wint_t);
+int iswxdigit(wint_t);
+wchar_t towlower(wchar_t);
+wchar_t towupper(wchar_t);
 #endif /* MSVCRT_WCTYPE_DEFINED */
 
 #ifndef MSVCRT_WDIRECT_DEFINED
 #define MSVCRT_WDIRECT_DEFINED
-int              _wchdir(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)* _wgetcwd(MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)* _wgetdcwd(int,MSVCRT(wchar_t)*,int);
-int              _wmkdir(const MSVCRT(wchar_t)*);
-int              _wrmdir(const MSVCRT(wchar_t)*);
+int              _wchdir(const wchar_t*);
+wchar_t* _wgetcwd(wchar_t*,int);
+wchar_t* _wgetdcwd(int,wchar_t*,int);
+int              _wmkdir(const wchar_t*);
+int              _wrmdir(const wchar_t*);
 #endif /* MSVCRT_WDIRECT_DEFINED */
 
 #ifndef MSVCRT_WIO_DEFINED
 #define MSVCRT_WIO_DEFINED
-int         _waccess(const MSVCRT(wchar_t)*,int);
-int         _wchmod(const MSVCRT(wchar_t)*,int);
-int         _wcreat(const MSVCRT(wchar_t)*,int);
-long        _wfindfirst(const MSVCRT(wchar_t)*,struct _wfinddata_t*);
-long        _wfindfirsti64(const MSVCRT(wchar_t)*, struct _wfinddatai64_t*);
+int         _waccess(const wchar_t*,int);
+int         _wchmod(const wchar_t*,int);
+int         _wcreat(const wchar_t*,int);
+long        _wfindfirst(const wchar_t*,struct _wfinddata_t*);
+long        _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
 int         _wfindnext(long,struct _wfinddata_t*);
 int         _wfindnexti64(long, struct _wfinddatai64_t*);
-MSVCRT(wchar_t)*_wmktemp(MSVCRT(wchar_t)*);
-int         _wopen(const MSVCRT(wchar_t)*,int,...);
-int         _wrename(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int         _wsopen(const MSVCRT(wchar_t)*,int,int,...);
-int         _wunlink(const MSVCRT(wchar_t)*);
+wchar_t*_wmktemp(wchar_t*);
+int         _wopen(const wchar_t*,int,...);
+int         _wrename(const wchar_t*,const wchar_t*);
+int         _wsopen(const wchar_t*,int,int,...);
+int         _wunlink(const wchar_t*);
 #endif /* MSVCRT_WIO_DEFINED */
 
 #ifndef MSVCRT_WLOCALE_DEFINED
 #define MSVCRT_WLOCALE_DEFINED
-MSVCRT(wchar_t)* _wsetlocale(int,const MSVCRT(wchar_t)*);
+wchar_t* _wsetlocale(int,const wchar_t*);
 #endif /* MSVCRT_WLOCALE_DEFINED */
 
 #ifndef MSVCRT_WPROCESS_DEFINED
 #define MSVCRT_WPROCESS_DEFINED
-int         _wexecl(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexecle(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexeclp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexeclpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexecv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wexecve(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wexecvp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wexecvpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wspawnl(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnle(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnlp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnlpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnv(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wspawnve(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wspawnvp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wspawnvpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wsystem(const MSVCRT(wchar_t)*);
+int         _wexecl(const wchar_t*,const wchar_t*,...);
+int         _wexecle(const wchar_t*,const wchar_t*,...);
+int         _wexeclp(const wchar_t*,const wchar_t*,...);
+int         _wexeclpe(const wchar_t*,const wchar_t*,...);
+int         _wexecv(const wchar_t*,const wchar_t* const *);
+int         _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wexecvp(const wchar_t*,const wchar_t* const *);
+int         _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wspawnl(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnle(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnlp(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnlpe(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnv(int,const wchar_t*,const wchar_t* const *);
+int         _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wspawnvp(int,const wchar_t*,const wchar_t* const *);
+int         _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wsystem(const wchar_t*);
 #endif /* MSVCRT_WPROCESS_DEFINED */
 
 #ifndef MSVCRT_WSTAT_DEFINED
 #define MSVCRT_WSTAT_DEFINED
-int _wstat(const MSVCRT(wchar_t)*,struct MSVCRT(_stat)*);
-int _wstati64(const MSVCRT(wchar_t)*,struct MSVCRT(_stati64)*);
+int _wstat(const wchar_t*,struct _stat*);
+int _wstati64(const wchar_t*,struct _stati64*);
 #endif /* MSVCRT_WSTAT_DEFINED */
 
 #ifndef MSVCRT_WSTDIO_DEFINED
 #define MSVCRT_WSTDIO_DEFINED
-MSVCRT(wint_t)  _fgetwchar(void);
-MSVCRT(wint_t)  _fputwchar(MSVCRT(wint_t));
-MSVCRT(wchar_t)*_getws(MSVCRT(wchar_t)*);
-int             _putws(const MSVCRT(wchar_t)*);
-int             _snwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,...);
-int             _vsnwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,va_list);
-MSVCRT(FILE)*   _wfdopen(int,const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   _wfopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   _wfreopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-MSVCRT(FILE)*   _wfsopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,int);
-void            _wperror(const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   _wpopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             _wremove(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wtempnam(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wtmpnam(MSVCRT(wchar_t)*);
-
-MSVCRT(wint_t)  MSVCRT(fgetwc)(MSVCRT(FILE)*);
-MSVCRT(wchar_t)*MSVCRT(fgetws)(MSVCRT(wchar_t)*,int,MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(fputwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-int             MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-int             MSVCRT(fwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
-int             MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-int             MSVCRT(fwscanf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
-MSVCRT(wint_t)  MSVCRT(getwc)(MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(getwchar)(void);
-MSVCRT(wchar_t)*MSVCRT(getws)(MSVCRT(wchar_t)*);
-MSVCRT(wint_t)  MSVCRT(putwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(putwchar)(MSVCRT(wint_t));
-int             MSVCRT(putws)(const MSVCRT(wchar_t)*);
-int             MSVCRT(swprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int             MSVCRT(swscanf)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-MSVCRT(wint_t)  MSVCRT(ungetwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-int             MSVCRT(vfwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(vswprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(vwprintf)(const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(wprintf)(const MSVCRT(wchar_t)*,...);
-int             MSVCRT(wscanf)(const MSVCRT(wchar_t)*,...);
+wint_t  _fgetwchar(void);
+wint_t  _fputwchar(wint_t);
+wchar_t*_getws(wchar_t*);
+int             _putws(const wchar_t*);
+int             _snwprintf(wchar_t*,size_t,const wchar_t*,...);
+int             _vsnwprintf(wchar_t*,size_t,const wchar_t*,va_list);
+FILE*   _wfdopen(int,const wchar_t*);
+FILE*   _wfopen(const wchar_t*,const wchar_t*);
+FILE*   _wfreopen(const wchar_t*,const wchar_t*,FILE*);
+FILE*   _wfsopen(const wchar_t*,const wchar_t*,int);
+void            _wperror(const wchar_t*);
+FILE*   _wpopen(const wchar_t*,const wchar_t*);
+int             _wremove(const wchar_t*);
+wchar_t*_wtempnam(const wchar_t*,const wchar_t*);
+wchar_t*_wtmpnam(wchar_t*);
+
+wint_t  fgetwc(FILE*);
+wchar_t*fgetws(wchar_t*,int,FILE*);
+wint_t  fputwc(wint_t,FILE*);
+int             fputws(const wchar_t*,FILE*);
+int             fwprintf(FILE*,const wchar_t*,...);
+int             fputws(const wchar_t*,FILE*);
+int             fwscanf(FILE*,const wchar_t*,...);
+wint_t  getwc(FILE*);
+wint_t  getwchar(void);
+wchar_t*getws(wchar_t*);
+wint_t  putwc(wint_t,FILE*);
+wint_t  putwchar(wint_t);
+int             putws(const wchar_t*);
+int             swprintf(wchar_t*,const wchar_t*,...);
+int             swscanf(const wchar_t*,const wchar_t*,...);
+wint_t  ungetwc(wint_t,FILE*);
+int             vfwprintf(FILE*,const wchar_t*,va_list);
+int             vswprintf(wchar_t*,const wchar_t*,va_list);
+int             vwprintf(const wchar_t*,va_list);
+int             wprintf(const wchar_t*,...);
+int             wscanf(const wchar_t*,...);
 #endif /* MSVCRT_WSTDIO_DEFINED */
 
 #ifndef MSVCRT_WSTDLIB_DEFINED
 #define MSVCRT_WSTDLIB_DEFINED
-MSVCRT(wchar_t)*_itow(int,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_i64tow(__int64,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ltow(long,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ui64tow(unsigned __int64,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ultow(unsigned long,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_wfullpath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,size_t);
-MSVCRT(wchar_t)*_wgetenv(const MSVCRT(wchar_t)*);
-void            _wmakepath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-void            _wperror(const MSVCRT(wchar_t)*);
-int             _wputenv(const MSVCRT(wchar_t)*);
-void            _wsearchenv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
-void            _wsplitpath(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
-int             _wsystem(const MSVCRT(wchar_t)*);
-int             _wtoi(const MSVCRT(wchar_t)*);
-__int64         _wtoi64(const MSVCRT(wchar_t)*);
-long            _wtol(const MSVCRT(wchar_t)*);
-
-MSVCRT(size_t) MSVCRT(mbstowcs)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
-int            MSVCRT(mbtowc)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
-double         MSVCRT(wcstod)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**);
-long           MSVCRT(wcstol)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
-MSVCRT(size_t) MSVCRT(wcstombs)(char*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-unsigned long  MSVCRT(wcstoul)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
-int            MSVCRT(wctomb)(char*,MSVCRT(wchar_t));
+wchar_t*_itow(int,wchar_t*,int);
+wchar_t*_i64tow(__int64,wchar_t*,int);
+wchar_t*_ltow(long,wchar_t*,int);
+wchar_t*_ui64tow(unsigned __int64,wchar_t*,int);
+wchar_t*_ultow(unsigned long,wchar_t*,int);
+wchar_t*_wfullpath(wchar_t*,const wchar_t*,size_t);
+wchar_t*_wgetenv(const wchar_t*);
+void            _wmakepath(wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*);
+void            _wperror(const wchar_t*);
+int             _wputenv(const wchar_t*);
+void            _wsearchenv(const wchar_t*,const wchar_t*,wchar_t*);
+void            _wsplitpath(const wchar_t*,wchar_t*,wchar_t*,wchar_t*,wchar_t*);
+int             _wsystem(const wchar_t*);
+int             _wtoi(const wchar_t*);
+__int64         _wtoi64(const wchar_t*);
+long            _wtol(const wchar_t*);
+
+size_t mbstowcs(wchar_t*,const char*,size_t);
+int            mbtowc(wchar_t*,const char*,size_t);
+double         wcstod(const wchar_t*,wchar_t**);
+long           wcstol(const wchar_t*,wchar_t**,int);
+size_t wcstombs(char*,const wchar_t*,size_t);
+unsigned long  wcstoul(const wchar_t*,wchar_t**,int);
+int            wctomb(char*,wchar_t);
 #endif /* MSVCRT_WSTDLIB_DEFINED */
 
 #ifndef MSVCRT_WSTRING_DEFINED
 #define MSVCRT_WSTRING_DEFINED
-MSVCRT(wchar_t)*_wcsdup(const MSVCRT(wchar_t)*);
-int             _wcsicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             _wcsicoll(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wcslwr(MSVCRT(wchar_t)*);
-int             _wcsnicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*_wcsnset(MSVCRT(wchar_t)*,MSVCRT(wchar_t),MSVCRT(size_t));
-MSVCRT(wchar_t)*_wcsrev(MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wcsset(MSVCRT(wchar_t)*,MSVCRT(wchar_t));
-MSVCRT(wchar_t)*_wcsupr(MSVCRT(wchar_t)*);
-
-MSVCRT(wchar_t)*MSVCRT(wcscat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcschr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t));
-int             MSVCRT(wcscmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             MSVCRT(wcscoll)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcscpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcscspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcslen)(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsncat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-int             MSVCRT(wcsncmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*MSVCRT(wcsncpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*MSVCRT(wcspbrk)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsrchr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t) wcFor);
-MSVCRT(size_t)  MSVCRT(wcsspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsstr)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcstok)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcsxfrm)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
+wchar_t*_wcsdup(const wchar_t*);
+int             _wcsicmp(const wchar_t*,const wchar_t*);
+int             _wcsicoll(const wchar_t*,const wchar_t*);
+wchar_t*_wcslwr(wchar_t*);
+int             _wcsnicmp(const wchar_t*,const wchar_t*,size_t);
+wchar_t*_wcsnset(wchar_t*,wchar_t,size_t);
+wchar_t*_wcsrev(wchar_t*);
+wchar_t*_wcsset(wchar_t*,wchar_t);
+wchar_t*_wcsupr(wchar_t*);
+
+wchar_t*wcscat(wchar_t*,const wchar_t*);
+wchar_t*wcschr(const wchar_t*,wchar_t);
+int             wcscmp(const wchar_t*,const wchar_t*);
+int             wcscoll(const wchar_t*,const wchar_t*);
+wchar_t*wcscpy(wchar_t*,const wchar_t*);
+size_t  wcscspn(const wchar_t*,const wchar_t*);
+size_t  wcslen(const wchar_t*);
+wchar_t*wcsncat(wchar_t*,const wchar_t*,size_t);
+int             wcsncmp(const wchar_t*,const wchar_t*,size_t);
+wchar_t*wcsncpy(wchar_t*,const wchar_t*,size_t);
+wchar_t*wcspbrk(const wchar_t*,const wchar_t*);
+wchar_t*wcsrchr(const wchar_t*,wchar_t wcFor);
+size_t  wcsspn(const wchar_t*,const wchar_t*);
+wchar_t*wcsstr(const wchar_t*,const wchar_t*);
+wchar_t*wcstok(wchar_t*,const wchar_t*);
+size_t  wcsxfrm(wchar_t*,const wchar_t*,size_t);
 #endif /* MSVCRT_WSTRING_DEFINED */
 
 #ifndef MSVCRT_WTIME_DEFINED
 #define MSVCRT_WTIME_DEFINED
-MSVCRT(wchar_t)*_wasctime(const struct MSVCRT(tm)*);
-MSVCRT(size_t)  wcsftime(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,const struct MSVCRT(tm)*);
-MSVCRT(wchar_t)*_wctime(const MSVCRT(time_t)*);
-MSVCRT(wchar_t)*_wstrdate(MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wstrtime(MSVCRT(wchar_t)*);
+wchar_t*_wasctime(const struct tm*);
+size_t  wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*);
+wchar_t*_wctime(const time_t*);
+wchar_t*_wstrdate(wchar_t*);
+wchar_t*_wstrtime(wchar_t*);
 #endif /* MSVCRT_WTIME_DEFINED */
 
-MSVCRT(wchar_t) btowc(int);
-MSVCRT(size_t)  mbrlen(const char *,MSVCRT(size_t),MSVCRT(mbstate_t)*);
-MSVCRT(size_t)  mbrtowc(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t),MSVCRT(mbstate_t)*);
-MSVCRT(size_t)  mbsrtowcs(MSVCRT(wchar_t)*,const char**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
-MSVCRT(size_t)  wcrtomb(char*,MSVCRT(wchar_t),MSVCRT(mbstate_t)*);
-MSVCRT(size_t)  wcsrtombs(char*,const MSVCRT(wchar_t)**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
-int             wctob(MSVCRT(wint_t));
+wchar_t btowc(int);
+size_t  mbrlen(const char *,size_t,mbstate_t*);
+size_t  mbrtowc(wchar_t*,const char*,size_t,mbstate_t*);
+size_t  mbsrtowcs(wchar_t*,const char**,size_t,mbstate_t*);
+size_t  wcrtomb(char*,wchar_t,mbstate_t*);
+size_t  wcsrtombs(char*,const wchar_t**,size_t,mbstate_t*);
+int             wctob(wint_t);
 
 #ifdef __cplusplus
 }
Index: include/msvcrt/wctype.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/wctype.h,v
retrieving revision 1.7
diff -u -r1.7 wctype.h
--- include/msvcrt/wctype.h	26 Apr 2004 23:31:39 -0000	1.7
+++ include/msvcrt/wctype.h	16 Jun 2004 05:56:22 -0000
@@ -23,18 +23,10 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -50,19 +42,13 @@
 #define _LEADBYTE     0x8000
 #define _ALPHA       (0x0100|_UPPER|_LOWER)  /* (C1_ALPHA|_UPPER|_LOWER) */
 
-#ifndef USE_MSVCRT_PREFIX
-# ifndef WEOF
-#  define WEOF        (wint_t)(0xFFFF)
-# endif
-#else
-# ifndef MSVCRT_WEOF
-#  define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
-# endif
-#endif /* USE_MSVCRT_PREFIX */
+#ifndef WEOF
+#define WEOF        (wint_t)(0xFFFF)
+#endif
 
 #ifndef _WCTYPE_T_DEFINED
-typedef unsigned short  MSVCRT(wint_t);
-typedef unsigned short  MSVCRT(wctype_t);
+typedef unsigned short  wint_t;
+typedef unsigned short  wctype_t;
 #define _WCTYPE_T_DEFINED
 #endif
 
@@ -75,23 +61,23 @@
 
 #ifndef MSVCRT_WCTYPE_DEFINED
 #define MSVCRT_WCTYPE_DEFINED
-int MSVCRT(is_wctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
-int MSVCRT(isleadbyte)(int);
-int MSVCRT(iswalnum)(MSVCRT(wint_t));
-int MSVCRT(iswalpha)(MSVCRT(wint_t));
-int MSVCRT(iswascii)(MSVCRT(wint_t));
-int MSVCRT(iswcntrl)(MSVCRT(wint_t));
-int MSVCRT(iswctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
-int MSVCRT(iswdigit)(MSVCRT(wint_t));
-int MSVCRT(iswgraph)(MSVCRT(wint_t));
-int MSVCRT(iswlower)(MSVCRT(wint_t));
-int MSVCRT(iswprint)(MSVCRT(wint_t));
-int MSVCRT(iswpunct)(MSVCRT(wint_t));
-int MSVCRT(iswspace)(MSVCRT(wint_t));
-int MSVCRT(iswupper)(MSVCRT(wint_t));
-int MSVCRT(iswxdigit)(MSVCRT(wint_t));
-MSVCRT(wchar_t) MSVCRT(towlower)(MSVCRT(wchar_t));
-MSVCRT(wchar_t) MSVCRT(towupper)(MSVCRT(wchar_t));
+int is_wctype(wint_t,wctype_t);
+int isleadbyte(int);
+int iswalnum(wint_t);
+int iswalpha(wint_t);
+int iswascii(wint_t);
+int iswcntrl(wint_t);
+int iswctype(wint_t,wctype_t);
+int iswdigit(wint_t);
+int iswgraph(wint_t);
+int iswlower(wint_t);
+int iswprint(wint_t);
+int iswpunct(wint_t);
+int iswspace(wint_t);
+int iswupper(wint_t);
+int iswxdigit(wint_t);
+wchar_t towlower(wchar_t);
+wchar_t towupper(wchar_t);
 #endif /* MSVCRT_WCTYPE_DEFINED */
 
 #ifdef __cplusplus
Index: include/msvcrt/sys/stat.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/sys/stat.h,v
retrieving revision 1.12
diff -u -r1.12 stat.h
--- include/msvcrt/sys/stat.h	16 Mar 2004 19:17:11 -0000	1.12
+++ include/msvcrt/sys/stat.h	16 Jun 2004 05:54:02 -0000
@@ -13,18 +13,10 @@
 
 #include <sys/types.h>
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -35,22 +27,22 @@
 #endif
 
 #ifndef MSVCRT_DEV_T_DEFINED
-typedef unsigned int MSVCRT(_dev_t);
+typedef unsigned int _dev_t;
 #define MSVCRT_DEV_T_DEFINED
 #endif
 
 #ifndef MSVCRT_INO_T_DEFINED
-typedef unsigned short MSVCRT(_ino_t);
+typedef unsigned short _ino_t;
 #define MSVCRT_INO_T_DEFINED
 #endif
 
 #ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
+typedef long time_t;
 #define MSVCRT_TIME_T_DEFINED
 #endif
 
 #ifndef MSVCRT_OFF_T_DEFINED
-typedef int MSVCRT(_off_t);
+typedef int _off_t;
 #define MSVCRT_OFF_T_DEFINED
 #endif
 
@@ -71,46 +63,46 @@
 #ifndef MSVCRT_STAT_DEFINED
 #define MSVCRT_STAT_DEFINED
 
-struct MSVCRT(_stat) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct _stat {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
-  MSVCRT(_off_t) st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  _dev_t st_rdev;
+  _off_t st_size;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
 
-struct MSVCRT(stat) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct stat {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
-  MSVCRT(_off_t) st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  _dev_t st_rdev;
+  _off_t st_size;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
 
-struct MSVCRT(_stati64) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct _stati64 {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
+  _dev_t st_rdev;
   __int64        st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
 #endif /* MSVCRT_STAT_DEFINED */
 
@@ -118,16 +110,16 @@
 extern "C" {
 #endif
 
-int MSVCRT(_fstat)(int,struct MSVCRT(_stat)*);
-int MSVCRT(_stat)(const char*,struct MSVCRT(_stat)*);
-int MSVCRT(_fstati64)(int,struct MSVCRT(_stati64)*);
-int MSVCRT(_stati64)(const char*,struct MSVCRT(_stati64)*);
+int _fstat(int,struct _stat*);
+int _stat(const char*,struct _stat*);
+int _fstati64(int,struct _stati64*);
+int _stati64(const char*,struct _stati64*);
 int _umask(int);
 
 #ifndef MSVCRT_WSTAT_DEFINED
 #define MSVCRT_WSTAT_DEFINED
-int MSVCRT(_wstat)(const MSVCRT(wchar_t)*,struct MSVCRT(_stat)*);
-int MSVCRT(_wstati64)(const MSVCRT(wchar_t)*,struct MSVCRT(_stati64)*);
+int _wstat(const wchar_t*,struct _stat*);
+int _wstati64(const wchar_t*,struct _stati64*);
 #endif /* MSVCRT_WSTAT_DEFINED */
 
 #ifdef __cplusplus
Index: include/msvcrt/sys/timeb.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/sys/timeb.h,v
retrieving revision 1.6
diff -u -r1.6 timeb.h
--- include/msvcrt/sys/timeb.h	18 Jul 2003 22:57:15 -0000	1.6
+++ include/msvcrt/sys/timeb.h	16 Jun 2004 05:53:18 -0000
@@ -23,16 +23,8 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
+typedef long time_t;
 #define MSVCRT_TIME_T_DEFINED
 #endif
 
@@ -40,7 +32,7 @@
 #define MSVCRT_TIMEB_DEFINED
 struct _timeb
 {
-    MSVCRT(time_t) time;
+    time_t time;
     unsigned short millitm;
     short          timezone;
     short          dstflag;
Index: include/msvcrt/sys/types.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/sys/types.h,v
retrieving revision 1.9
diff -u -r1.9 types.h
--- include/msvcrt/sys/types.h	18 Jul 2003 22:57:15 -0000	1.9
+++ include/msvcrt/sys/types.h	16 Jun 2004 05:53:18 -0000
@@ -23,14 +23,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_DEV_T_DEFINED
 typedef unsigned int   _dev_t;
 #define MSVCRT_DEV_T_DEFINED
@@ -47,12 +39,12 @@
 #endif
 
 #ifndef MSVCRT_OFF_T_DEFINED
-typedef int MSVCRT(_off_t);
+typedef int _off_t;
 #define MSVCRT_OFF_T_DEFINED
 #endif
 
 #ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
+typedef long time_t;
 #define MSVCRT_TIME_T_DEFINED
 #endif
 
Index: include/msvcrt/sys/utime.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/sys/utime.h,v
retrieving revision 1.6
diff -u -r1.6 utime.h
--- include/msvcrt/sys/utime.h	18 Jul 2003 22:57:15 -0000	1.6
+++ include/msvcrt/sys/utime.h	16 Jun 2004 05:53:18 -0000
@@ -23,23 +23,15 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef MSVCRT_WCHAR_T_DEFINED
 #define MSVCRT_WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
 #ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
+typedef long time_t;
 #define MSVCRT_TIME_T_DEFINED
 #endif
 
@@ -47,8 +39,8 @@
 #define MSVCRT_UTIMBUF_DEFINED
 struct _utimbuf
 {
-    MSVCRT(time_t) actime;
-    MSVCRT(time_t) modtime;
+    time_t actime;
+    time_t modtime;
 };
 #endif /* MSVCRT_UTIMBUF_DEFINED */
 
@@ -59,7 +51,7 @@
 int         _futime(int,struct _utimbuf*);
 int         _utime(const char*,struct _utimbuf*);
 
-int         _wutime(const MSVCRT(wchar_t)*,struct _utimbuf*);
+int         _wutime(const wchar_t*,struct _utimbuf*);
 
 #ifdef __cplusplus
 }
Index: dlls/msvcrt/console.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/console.c,v
retrieving revision 1.11
diff -u -r1.11 console.c
--- dlls/msvcrt/console.c	31 Oct 2003 04:17:45 -0000	1.11
+++ dlls/msvcrt/console.c	18 Jun 2004 04:33:40 -0000
@@ -22,12 +22,7 @@
  */
 #include "msvcrt.h"
 #include "wincon.h"
-
-#include "msvcrt/conio.h"
-#include "msvcrt/malloc.h"
-#include "msvcrt/stdio.h"
 #include "mtdll.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
Index: dlls/msvcrt/cpp.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/cpp.c,v
retrieving revision 1.17
diff -u -r1.17 cpp.c
--- dlls/msvcrt/cpp.c	9 Feb 2004 22:07:43 -0000	1.17
+++ dlls/msvcrt/cpp.c	18 Jun 2004 04:33:40 -0000
@@ -31,9 +31,6 @@
 #include "wine/exception.h"
 #include "excpt.h"
 #include "wine/debug.h"
-#include "msvcrt/malloc.h"
-#include "msvcrt/stdlib.h"
-
 #include "msvcrt.h"
 #include "cppexcept.h"
 #include "mtdll.h"
@@ -211,12 +208,12 @@
         int i, *ptr = (int *)_this - 1;
 
         for (i = *ptr - 1; i >= 0; i--) MSVCRT_exception_dtor(_this + i);
-        MSVCRT_operator_delete(ptr);
+        msvcrt_operator_delete(ptr);
     }
     else
     {
         MSVCRT_exception_dtor(_this);
-        if (flags & 1) MSVCRT_operator_delete(_this);
+        if (flags & 1) msvcrt_operator_delete(_this);
     }
     return _this;
 }
@@ -229,7 +226,7 @@
 {
     TRACE("(%p %x)\n", _this, flags);
     MSVCRT_exception_dtor(_this);
-    if (flags & 1) MSVCRT_operator_delete(_this);
+    if (flags & 1) msvcrt_operator_delete(_this);
     return _this;
 }
 
@@ -301,12 +298,12 @@
         int i, *ptr = (int *)_this - 1;
 
         for (i = *ptr - 1; i >= 0; i--) MSVCRT_bad_typeid_dtor(_this + i);
-        MSVCRT_operator_delete(ptr);
+        msvcrt_operator_delete(ptr);
     }
     else
     {
         MSVCRT_bad_typeid_dtor(_this);
-        if (flags & 1) MSVCRT_operator_delete(_this);
+        if (flags & 1) msvcrt_operator_delete(_this);
     }
     return _this;
 }
@@ -319,7 +316,7 @@
 {
     TRACE("(%p %x)\n", _this, flags);
     MSVCRT_bad_typeid_dtor(_this);
-    if (flags & 1) MSVCRT_operator_delete(_this);
+    if (flags & 1) msvcrt_operator_delete(_this);
     return _this;
 }
 
@@ -384,12 +381,12 @@
         int i, *ptr = (int *)_this - 1;
 
         for (i = *ptr - 1; i >= 0; i--) MSVCRT___non_rtti_object_dtor(_this + i);
-        MSVCRT_operator_delete(ptr);
+        msvcrt_operator_delete(ptr);
     }
     else
     {
         MSVCRT___non_rtti_object_dtor(_this);
-        if (flags & 1) MSVCRT_operator_delete(_this);
+        if (flags & 1) msvcrt_operator_delete(_this);
     }
     return _this;
 }
@@ -402,7 +399,7 @@
 {
   TRACE("(%p %x)\n", _this, flags);
   MSVCRT___non_rtti_object_dtor(_this);
-  if (flags & 1) MSVCRT_operator_delete(_this);
+  if (flags & 1) msvcrt_operator_delete(_this);
   return _this;
 }
 
@@ -464,12 +461,12 @@
         int i, *ptr = (int *)_this - 1;
 
         for (i = *ptr - 1; i >= 0; i--) MSVCRT_bad_cast_dtor(_this + i);
-        MSVCRT_operator_delete(ptr);
+        msvcrt_operator_delete(ptr);
     }
     else
     {
         MSVCRT_bad_cast_dtor(_this);
-        if (flags & 1) MSVCRT_operator_delete(_this);
+        if (flags & 1) msvcrt_operator_delete(_this);
     }
     return _this;
 }
@@ -482,7 +479,7 @@
 {
   TRACE("(%p %x)\n", _this, flags);
   MSVCRT_bad_cast_dtor(_this);
-  if (flags & 1) MSVCRT_operator_delete(_this);
+  if (flags & 1) msvcrt_operator_delete(_this);
   return _this;
 }
 
@@ -539,9 +536,9 @@
   if (!_this->name)
   {
     /* Create and set the demangled name */
-    char* name = MSVCRT___unDName(0, _this->mangled, 0,
-                                  (MSVCRT_malloc_func)MSVCRT_malloc,
-                                  (MSVCRT_free_func)MSVCRT_free, 0x2800);
+    char* name = msvcrt___unDName(0, _this->mangled, 0,
+                                  (malloc_func_t)MSVCRT_malloc,
+                                  (free_func_t)MSVCRT_free, 0x2800);
 
     if (name)
     {
@@ -589,12 +586,12 @@
         int i, *ptr = (int *)_this - 1;
 
         for (i = *ptr - 1; i >= 0; i--) MSVCRT_type_info_dtor(_this + i);
-        MSVCRT_operator_delete(ptr);
+        msvcrt_operator_delete(ptr);
     }
     else
     {
         MSVCRT_type_info_dtor(_this);
-        if (flags & 1) MSVCRT_operator_delete(_this);
+        if (flags & 1) msvcrt_operator_delete(_this);
     }
     return _this;
 }
@@ -953,10 +950,10 @@
  * RETURNS
  *  The previously installed handler function, if any.
  */
-terminate_function MSVCRT_set_terminate(terminate_function func)
+MSVCRT_terminate_function MSVCRT_set_terminate(MSVCRT_terminate_function func)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
-    terminate_function previous = data->terminate_handler;
+    thread_data_t *data = msvcrt_get_thread_data();
+    MSVCRT_terminate_function previous = data->terminate_handler;
     TRACE("(%p) returning %p\n",func,previous);
     data->terminate_handler = func;
     return previous;
@@ -973,10 +970,10 @@
  * RETURNS
  *  The previously installed handler function, if any.
  */
-unexpected_function MSVCRT_set_unexpected(unexpected_function func)
+MSVCRT_unexpected_function MSVCRT_set_unexpected(MSVCRT_unexpected_function func)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
-    unexpected_function previous = data->unexpected_handler;
+    thread_data_t *data = msvcrt_get_thread_data();
+    MSVCRT_unexpected_function previous = data->unexpected_handler;
     TRACE("(%p) returning %p\n",func,previous);
     data->unexpected_handler = func;
     return previous;
@@ -985,10 +982,10 @@
 /******************************************************************
  *              ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0 at Z@Z  (MSVCRT.@)
  */
-_se_translator_function MSVCRT__set_se_translator(_se_translator_function func)
+MSVCRT__se_translator_function MSVCRT__set_se_translator(MSVCRT__se_translator_function func)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
-    _se_translator_function previous = data->se_translator;
+    thread_data_t *data = msvcrt_get_thread_data();
+    MSVCRT__se_translator_function previous = data->se_translator;
     TRACE("(%p) returning %p\n",func,previous);
     data->se_translator = func;
     return previous;
@@ -1009,7 +1006,7 @@
  */
 void MSVCRT_terminate(void)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
+    thread_data_t *data = msvcrt_get_thread_data();
     if (data->terminate_handler) data->terminate_handler();
     MSVCRT_abort();
 }
@@ -1019,7 +1016,7 @@
  */
 void MSVCRT_unexpected(void)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
+    thread_data_t *data = msvcrt_get_thread_data();
     if (data->unexpected_handler) data->unexpected_handler();
     MSVCRT_terminate();
 }
Index: dlls/msvcrt/cppexcept.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/cppexcept.c,v
retrieving revision 1.9
diff -u -r1.9 cppexcept.c
--- dlls/msvcrt/cppexcept.c	4 Dec 2003 05:51:01 -0000	1.9
+++ dlls/msvcrt/cppexcept.c	18 Jun 2004 04:33:40 -0000
@@ -269,7 +269,7 @@
     void *addr, *object = (void *)rec->ExceptionInformation[1];
     struct catch_func_nested_frame nested_frame;
     int trylevel = frame->trylevel;
-    MSVCRT_thread_data *thread_data = msvcrt_get_thread_data();
+    thread_data_t *thread_data = msvcrt_get_thread_data();
 
     for (i = 0; i < descr->tryblock_count; i++)
     {
Index: dlls/msvcrt/ctype.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/ctype.c,v
retrieving revision 1.7
diff -u -r1.7 ctype.c
--- dlls/msvcrt/ctype.c	19 Dec 2002 04:21:30 -0000	1.7
+++ dlls/msvcrt/ctype.c	18 Jun 2004 04:50:55 -0000
@@ -18,26 +18,23 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include "msvcrt.h"
-
-#include "msvcrt/ctype.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
 /* Some abbreviations to make the following table readable */
-#define _C_ _CONTROL
-#define _S_ _SPACE
-#define _P_ _PUNCT
-#define _D_ _DIGIT
-#define _H_ _HEX
-#define _U_ _UPPER
-#define _L_ _LOWER
+#define _C_ MSVCRT__CONTROL
+#define _S_ MSVCRT__SPACE
+#define _P_ MSVCRT__PUNCT
+#define _D_ MSVCRT__DIGIT
+#define _H_ MSVCRT__HEX
+#define _U_ MSVCRT__UPPER
+#define _L_ MSVCRT__LOWER
 
 WORD MSVCRT__ctype [257] = {
   0, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _S_|_C_, _S_|_C_,
   _S_|_C_, _S_|_C_, _S_|_C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_,
-  _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _S_|_BLANK,
+  _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _S_|MSVCRT__BLANK,
   _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_,
   _P_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_,
   _D_|_H_, _D_|_H_, _D_|_H_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _U_|_H_,
@@ -90,7 +87,7 @@
     WORD typeInfo;
     char convert[3], *pconv = convert;
 
-    if (MSVCRT__pctype[(UINT)c >> 8] & _LEADBYTE)
+    if (MSVCRT__pctype[(UINT)c >> 8] & MSVCRT__LEADBYTE)
       *pconv++ = (UINT)c >> 8;
     *pconv++ = c & 0xff;
     *pconv = 0;
@@ -107,7 +104,7 @@
  */
 int MSVCRT_isalnum(int c)
 {
-  return _isctype( c, _ALPHA | _DIGIT );
+  return _isctype( c, MSVCRT__ALPHA | MSVCRT__DIGIT );
 }
 
 /*********************************************************************
@@ -115,7 +112,7 @@
  */
 int MSVCRT_isalpha(int c)
 {
-  return _isctype( c, _ALPHA );
+  return _isctype( c, MSVCRT__ALPHA );
 }
 
 /*********************************************************************
@@ -123,7 +120,7 @@
  */
 int MSVCRT_iscntrl(int c)
 {
-  return _isctype( c, _CONTROL );
+  return _isctype( c, MSVCRT__CONTROL );
 }
 
 /*********************************************************************
@@ -131,7 +128,7 @@
  */
 int MSVCRT_isdigit(int c)
 {
-  return _isctype( c, _DIGIT );
+  return _isctype( c, MSVCRT__DIGIT );
 }
 
 /*********************************************************************
@@ -139,7 +136,7 @@
  */
 int MSVCRT_isgraph(int c)
 {
-  return _isctype( c, _ALPHA | _DIGIT | _PUNCT );
+  return _isctype( c, MSVCRT__ALPHA | MSVCRT__DIGIT | MSVCRT__PUNCT );
 }
 
 /*********************************************************************
@@ -147,7 +144,7 @@
  */
 int MSVCRT_isleadbyte(int c)
 {
-  return _isctype( c, _LEADBYTE );
+  return _isctype( c, MSVCRT__LEADBYTE );
 }
 
 /*********************************************************************
@@ -155,7 +152,7 @@
  */
 int MSVCRT_islower(int c)
 {
-  return _isctype( c, _LOWER );
+  return _isctype( c, MSVCRT__LOWER );
 }
 
 /*********************************************************************
@@ -163,7 +160,7 @@
  */
 int MSVCRT_isprint(int c)
 {
-  return _isctype( c, _ALPHA | _DIGIT | _BLANK | _PUNCT );
+  return _isctype( c, MSVCRT__ALPHA | MSVCRT__DIGIT | MSVCRT__BLANK | MSVCRT__PUNCT );
 }
 
 /*********************************************************************
@@ -171,7 +168,7 @@
  */
 int MSVCRT_ispunct(int c)
 {
-  return _isctype( c, _PUNCT );
+  return _isctype( c, MSVCRT__PUNCT );
 }
 
 /*********************************************************************
@@ -179,7 +176,7 @@
  */
 int MSVCRT_isspace(int c)
 {
-  return _isctype( c, _SPACE );
+  return _isctype( c, MSVCRT__SPACE );
 }
 
 /*********************************************************************
@@ -187,7 +184,7 @@
  */
 int MSVCRT_isupper(int c)
 {
-  return _isctype( c, _UPPER );
+  return _isctype( c, MSVCRT__UPPER );
 }
 
 /*********************************************************************
@@ -195,7 +192,7 @@
  */
 int MSVCRT_isxdigit(int c)
 {
-  return _isctype( c, _HEX );
+  return _isctype( c, MSVCRT__HEX );
 }
 
 /*********************************************************************
Index: dlls/msvcrt/data.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/data.c,v
retrieving revision 1.23
diff -u -r1.23 data.c
--- dlls/msvcrt/data.c	19 May 2004 03:22:56 -0000	1.23
+++ dlls/msvcrt/data.c	18 Jun 2004 04:33:40 -0000
@@ -23,11 +23,7 @@
 
 #include <math.h>
 #include "msvcrt.h"
-
 #include "msvcrt/fcntl.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-
 #include "wine/library.h"
 #include "wine/unicode.h"
 #include "wine/debug.h"
@@ -57,8 +53,8 @@
 MSVCRT_wchar_t **MSVCRT___wargv;
 char *MSVCRT__acmdln;
 MSVCRT_wchar_t *MSVCRT__wcmdln;
-char **MSVCRT__environ = 0;
-MSVCRT_wchar_t **MSVCRT__wenviron = 0;
+char **msvcrt__environ = 0;
+MSVCRT_wchar_t **msvcrt__wenviron = 0;
 char **MSVCRT___initenv = 0;
 MSVCRT_wchar_t **MSVCRT___winitenv = 0;
 int MSVCRT_timezone;
@@ -211,9 +207,9 @@
  */
 char*** __p__environ(void)
 {
-  if (!MSVCRT__environ)
-    MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(NULL);
-  return &MSVCRT__environ;
+  if (!msvcrt__environ)
+    msvcrt__environ = msvcrt_SnapshotOfEnvironmentA(NULL);
+  return &msvcrt__environ;
 }
 
 /*********************************************************************
@@ -221,9 +217,9 @@
  */
 MSVCRT_wchar_t*** __p__wenviron(void)
 {
-  if (!MSVCRT__wenviron)
-    MSVCRT__wenviron = msvcrt_SnapshotOfEnvironmentW(NULL);
-  return &MSVCRT__wenviron;
+  if (!msvcrt__wenviron)
+    msvcrt__wenviron = msvcrt_SnapshotOfEnvironmentW(NULL);
+  return &msvcrt__wenviron;
 }
 
 /*********************************************************************
@@ -317,8 +313,8 @@
   /* FIXME: more things to free */
   if (MSVCRT___initenv) HeapFree(GetProcessHeap(), 0, MSVCRT___initenv);
   if (MSVCRT___winitenv) HeapFree(GetProcessHeap(), 0, MSVCRT___winitenv);
-  if (MSVCRT__environ) HeapFree(GetProcessHeap(), 0, MSVCRT__environ);
-  if (MSVCRT__wenviron) HeapFree(GetProcessHeap(), 0, MSVCRT__wenviron);
+  if (msvcrt__environ) HeapFree(GetProcessHeap(), 0, msvcrt__environ);
+  if (msvcrt__wenviron) HeapFree(GetProcessHeap(), 0, msvcrt__wenviron);
   if (MSVCRT__pgmptr) HeapFree(GetProcessHeap(), 0, MSVCRT__pgmptr);
   if (MSVCRT__wpgmptr) HeapFree(GetProcessHeap(), 0, MSVCRT__wpgmptr);
 }
@@ -334,7 +330,7 @@
   *argv = MSVCRT___argv;
   *envp = MSVCRT___initenv;
   if (new_mode)
-    MSVCRT__set_new_mode( *new_mode );
+    msvcrt__set_new_mode( *new_mode );
 }
 
 /*********************************************************************
@@ -348,7 +344,7 @@
   *wargv = MSVCRT___wargv;
   *wenvp = MSVCRT___winitenv;
   if (new_mode)
-    MSVCRT__set_new_mode( *new_mode );
+    msvcrt__set_new_mode( *new_mode );
 }
 
 /*********************************************************************
Index: dlls/msvcrt/dir.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/dir.c,v
retrieving revision 1.28
diff -u -r1.28 dir.c
--- dlls/msvcrt/dir.c	17 May 2004 21:08:31 -0000	1.28
+++ dlls/msvcrt/dir.c	18 Jun 2004 04:33:40 -0000
@@ -33,14 +33,6 @@
 #include "winternl.h"
 #include "wine/unicode.h"
 #include "msvcrt.h"
-#include "msvcrt/errno.h"
-
-#include "wine/unicode.h"
-#include "msvcrt/io.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-#include "msvcrt/dos.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -144,7 +136,7 @@
 {
   if (!SetCurrentDirectoryA(newdir))
   {
-    MSVCRT__set_errno(newdir?GetLastError():0);
+    msvcrt_set_errno(newdir?GetLastError():0);
     return -1;
   }
   return 0;
@@ -159,7 +151,7 @@
 {
   if (!SetCurrentDirectoryW(newdir))
   {
-    MSVCRT__set_errno(newdir?GetLastError():0);
+    msvcrt_set_errno(newdir?GetLastError():0);
     return -1;
   }
   return 0;
@@ -187,7 +179,7 @@
   buffer[0] += newdrive - 1;
   if (!SetCurrentDirectoryW( buffer ))
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     if (newdrive <= 0)
       *MSVCRT__errno() = MSVCRT_EACCES;
     return -1;
@@ -215,7 +207,7 @@
   TRACE(":handle %ld\n",hand);
   if (!FindClose((HANDLE)hand))
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   return 0;
@@ -246,7 +238,7 @@
   hfind  = FindFirstFileA(fspec, &find_data);
   if (hfind == INVALID_HANDLE_VALUE)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   msvcrt_fttofd(&find_data,ft);
@@ -267,7 +259,7 @@
   hfind  = FindFirstFileW(fspec, &find_data);
   if (hfind == INVALID_HANDLE_VALUE)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   msvcrt_wfttofd(&find_data,ft);
@@ -288,7 +280,7 @@
   hfind  = FindFirstFileA(fspec, &find_data);
   if (hfind == INVALID_HANDLE_VALUE)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   msvcrt_fttofdi64(&find_data,ft);
@@ -309,7 +301,7 @@
   hfind  = FindFirstFileW(fspec, &find_data);
   if (hfind == INVALID_HANDLE_VALUE)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   msvcrt_wfttofdi64(&find_data,ft);
@@ -619,7 +611,7 @@
     return 0;
   }
   err = GetLastError();
-  MSVCRT__set_errno(err);
+  msvcrt_set_errno(err);
   return err;
 }
 
@@ -642,7 +634,7 @@
 {
   if (CreateDirectoryA(newdir,NULL))
     return 0;
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -655,7 +647,7 @@
 {
   if (CreateDirectoryW(newdir,NULL))
     return 0;
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -678,7 +670,7 @@
 {
   if (RemoveDirectoryA(dir))
     return 0;
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -691,7 +683,7 @@
 {
   if (RemoveDirectoryW(dir))
     return 0;
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -1216,7 +1208,7 @@
   {
     GetFullPathNameA( file, MAX_PATH, buf, NULL );
     /* Sigh. This error is *always* set, regardless of success */
-    MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+    msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
     return;
   }
 
@@ -1224,7 +1216,7 @@
   envVal = MSVCRT_getenv(env);
   if (!envVal)
   {
-    MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+    msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
     return;
   }
 
@@ -1238,7 +1230,7 @@
     while(*end && *end != ';') end++; /* Find end of next path */
     if (penv == end || !*penv)
     {
-      MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+      msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
       return;
     }
     strncpy(curPath, penv, end - penv);
@@ -1255,7 +1247,7 @@
     if (GetFileAttributesA( curPath ) != INVALID_FILE_ATTRIBUTES)
     {
       strcpy(buf, curPath);
-      MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+      msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
       return; /* Found */
     }
     penv = *end ? end + 1 : end;
Index: dlls/msvcrt/environ.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/environ.c,v
retrieving revision 1.11
diff -u -r1.11 environ.c
--- dlls/msvcrt/environ.c	24 Sep 2003 18:57:28 -0000	1.11
+++ dlls/msvcrt/environ.c	18 Jun 2004 04:33:40 -0000
@@ -22,10 +22,6 @@
  */
 #include "wine/unicode.h"
 #include "msvcrt.h"
-
-#include "msvcrt/stdlib.h"
-
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -97,10 +93,10 @@
 
  ret = !SetEnvironmentVariableA(name, value[0] ? value : NULL);
  /* Update the __p__environ array only when already initialized */
- if (MSVCRT__environ)
-   MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(MSVCRT__environ);
- if (MSVCRT__wenviron)
-   MSVCRT__wenviron = msvcrt_SnapshotOfEnvironmentW(MSVCRT__wenviron);
+ if (msvcrt__environ)
+   msvcrt__environ = msvcrt_SnapshotOfEnvironmentA(msvcrt__environ);
+ if (msvcrt__wenviron)
+   msvcrt__wenviron = msvcrt_SnapshotOfEnvironmentW(msvcrt__wenviron);
  return ret;
 }
 
@@ -129,9 +125,9 @@
 
  ret = !SetEnvironmentVariableW(name, value[0] ? value : NULL);
  /* Update the __p__environ array only when already initialized */
- if (MSVCRT__environ)
-   MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(MSVCRT__environ);
- if (MSVCRT__wenviron)
-   MSVCRT__wenviron = msvcrt_SnapshotOfEnvironmentW(MSVCRT__wenviron);
+ if (msvcrt__environ)
+   msvcrt__environ = msvcrt_SnapshotOfEnvironmentA(msvcrt__environ);
+ if (msvcrt__wenviron)
+   msvcrt__wenviron = msvcrt_SnapshotOfEnvironmentW(msvcrt__wenviron);
  return ret;
 }
Index: dlls/msvcrt/errno.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/errno.c,v
retrieving revision 1.12
diff -u -r1.12 errno.c
--- dlls/msvcrt/errno.c	16 Mar 2004 19:17:11 -0000	1.12
+++ dlls/msvcrt/errno.c	18 Jun 2004 04:37:55 -0000
@@ -18,24 +18,17 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "msvcrt.h"
-#include "msvcrt/errno.h"
-
 #include <stdio.h>
 #include <string.h>
 
-#include "msvcrt/conio.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-
-
+#include "msvcrt.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
 
 /* INTERNAL: Set the crt and dos errno's from the OS error given. */
-void MSVCRT__set_errno(int err)
+void msvcrt_set_errno(int err)
 {
   int *errno = MSVCRT__errno();
   unsigned long *doserrno = MSVCRT___doserrno();
@@ -154,10 +147,10 @@
  */
 int _set_error_mode(int mode)
 {
-  static int current_mode = _OUT_TO_DEFAULT;
+  static int current_mode = MSVCRT__OUT_TO_DEFAULT;
 
   const int old = current_mode;
-  if ( _REPORT_ERRMODE != mode ) {
+  if ( MSVCRT__REPORT_ERRMODE != mode ) {
     current_mode = mode;
     FIXME("dummy implementation (old mode: %d, new mode: %d)\n",
           old, mode);
Index: dlls/msvcrt/except.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/except.c,v
retrieving revision 1.29
diff -u -r1.29 except.c
--- dlls/msvcrt/except.c	4 Dec 2003 05:51:01 -0000	1.29
+++ dlls/msvcrt/except.c	18 Jun 2004 04:33:40 -0000
@@ -36,11 +36,7 @@
 #include "winternl.h"
 #include "wine/exception.h"
 #include "msvcrt.h"
-
-#include "msvcrt/setjmp.h"
 #include "excpt.h"
-
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -281,7 +277,7 @@
  *		_setjmp (MSVCRT.@)
  */
 DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp, _MSVCRT__setjmp, 4, 0 );
-void _MSVCRT__setjmp(_JUMP_BUFFER *jmp, CONTEXT86* context)
+void _MSVCRT__setjmp(struct MSVCRT___JUMP_BUFFER *jmp, CONTEXT86* context)
 {
     TRACE("(%p)\n",jmp);
     jmp->Ebp = context->Ebp;
@@ -303,7 +299,7 @@
  *		_setjmp3 (MSVCRT.@)
  */
 DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp3, _MSVCRT__setjmp3, 8, 0 );
-void _MSVCRT__setjmp3(_JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context)
+void _MSVCRT__setjmp3(struct MSVCRT___JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context)
 {
     TRACE("(%p,%d)\n",jmp,nb_args);
     jmp->Ebp = context->Ebp;
@@ -340,7 +336,7 @@
  *		longjmp (MSVCRT.@)
  */
 DEFINE_REGS_ENTRYPOINT( MSVCRT_longjmp, _MSVCRT_longjmp, 8, 0 );
-void _MSVCRT_longjmp(_JUMP_BUFFER *jmp, int retval, CONTEXT86* context)
+void _MSVCRT_longjmp(struct MSVCRT___JUMP_BUFFER *jmp, int retval, CONTEXT86* context)
 {
     unsigned long cur_frame = 0;
 
@@ -383,7 +379,7 @@
 /*********************************************************************
  *		_seh_longjmp_unwind (MSVCRT.@)
  */
-void __stdcall _seh_longjmp_unwind(_JUMP_BUFFER *jmp)
+void __stdcall _seh_longjmp_unwind(struct MSVCRT___JUMP_BUFFER *jmp)
 {
     _local_unwind2( (MSVCRT_EXCEPTION_FRAME *)jmp->Registration, jmp->TryLevel );
 }
Index: dlls/msvcrt/exit.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/exit.c,v
retrieving revision 1.12
diff -u -r1.12 exit.c
--- dlls/msvcrt/exit.c	16 Mar 2004 19:17:11 -0000	1.12
+++ dlls/msvcrt/exit.c	18 Jun 2004 04:33:40 -0000
@@ -19,12 +19,8 @@
  */
 #include <stdio.h>
 #include "msvcrt.h"
-
-#include "msvcrt/conio.h"
-#include "msvcrt/stdlib.h"
 #include "mtdll.h"
 #include "winuser.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -132,7 +128,7 @@
 /*********************************************************************
  *		_amsg_exit (MSVCRT.@)
  */
-void MSVCRT__amsg_exit(int errnum)
+void msvcrt__amsg_exit(int errnum)
 {
   TRACE("(%d)\n", errnum);
   /* FIXME: text for the error number. */
@@ -259,5 +255,5 @@
 void _purecall(void)
 {
   TRACE("(void)\n");
-  MSVCRT__amsg_exit( 25 );
+  msvcrt__amsg_exit( 25 );
 }
Index: dlls/msvcrt/file.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/file.c,v
retrieving revision 1.68
diff -u -r1.68 file.c
--- dlls/msvcrt/file.c	27 May 2004 20:01:34 -0000	1.68
+++ dlls/msvcrt/file.c	18 Jun 2004 04:45:46 -0000
@@ -31,36 +31,27 @@
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
+#include <sys/types.h>
 
 #include "windef.h"
 #include "winbase.h"
 #include "winreg.h"
 #include "winternl.h"
 #include "msvcrt.h"
-#include "msvcrt/errno.h"
 
 #include "wine/unicode.h"
 #include "msvcrt/fcntl.h"
-#include "msvcrt/io.h"
-#include "msvcrt/sys/locking.h"
-#include "msvcrt/stdio.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-#include "msvcrt/sys/stat.h"
-#include "msvcrt/sys/utime.h"
-#include "msvcrt/time.h"
 #include "msvcrt/share.h"
-#include "msvcrt/wctype.h"
-#include "msvcrt/direct.h"
+#include "msvcrt/sys/locking.h"
 
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
 /* for stat mode, permissions apply to all,owner and group */
-#define MSVCRT_S_IREAD  (_S_IREAD  | (_S_IREAD  >> 3) | (_S_IREAD  >> 6))
-#define MSVCRT_S_IWRITE (_S_IWRITE | (_S_IWRITE >> 3) | (_S_IWRITE >> 6))
-#define MSVCRT_S_IEXEC  (_S_IEXEC  | (_S_IEXEC  >> 3) | (_S_IEXEC  >> 6))
+#define ALL_S_IREAD  (MSVCRT__S_IREAD  | (MSVCRT__S_IREAD  >> 3) | (MSVCRT__S_IREAD  >> 6))
+#define ALL_S_IWRITE (MSVCRT__S_IWRITE | (MSVCRT__S_IWRITE >> 3) | (MSVCRT__S_IWRITE >> 6))
+#define ALL_S_IEXEC  (MSVCRT__S_IEXEC  | (MSVCRT__S_IEXEC  >> 3) | (MSVCRT__S_IEXEC  >> 6))
 
 /* _access() bit flags FIXME: incomplete */
 #define MSVCRT_W_OK      0x02
@@ -352,12 +343,12 @@
 
   if (!filename || attr == INVALID_FILE_ATTRIBUTES)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & MSVCRT_W_OK))
   {
-    MSVCRT__set_errno(ERROR_ACCESS_DENIED);
+    msvcrt_set_errno(ERROR_ACCESS_DENIED);
     return -1;
   }
   return 0;
@@ -374,12 +365,12 @@
 
   if (!filename || attr == INVALID_FILE_ATTRIBUTES)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & MSVCRT_W_OK))
   {
-    MSVCRT__set_errno(ERROR_ACCESS_DENIED);
+    msvcrt_set_errno(ERROR_ACCESS_DENIED);
     return -1;
   }
   return 0;
@@ -394,13 +385,13 @@
 
   if (oldFlags != INVALID_FILE_ATTRIBUTES)
   {
-    DWORD newFlags = (flags & _S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
+    DWORD newFlags = (flags & MSVCRT__S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
       oldFlags | FILE_ATTRIBUTE_READONLY;
 
     if (newFlags == oldFlags || SetFileAttributesA(path, newFlags))
       return 0;
   }
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -413,13 +404,13 @@
 
   if (oldFlags != INVALID_FILE_ATTRIBUTES)
   {
-    DWORD newFlags = (flags & _S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
+    DWORD newFlags = (flags & MSVCRT__S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
       oldFlags | FILE_ATTRIBUTE_READONLY;
 
     if (newFlags == oldFlags || SetFileAttributesW(path, newFlags))
       return 0;
   }
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -459,7 +450,7 @@
   if(DeleteFileA(path))
     return 0;
   TRACE("failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -472,7 +463,7 @@
   if(DeleteFileW(path))
     return 0;
   TRACE("failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -533,7 +524,7 @@
   if (!CloseHandle(hand))
   {
     WARN(":failed-last error (%ld)\n",GetLastError());
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   msvcrt_free_fd(fd);
@@ -562,7 +553,7 @@
       return 0;
     }
     TRACE(":failed-last error (%ld)\n",GetLastError());
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   TRACE(":ok\n");
@@ -654,7 +645,7 @@
     return ((__int64)hoffset << 32) | ret;
   }
   TRACE(":error-last error (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -709,7 +700,7 @@
     {
       ret = LockFile(hand, cur_locn, 0L, nbytes, 0L);
       if (ret) break;
-      _sleep (1);
+      Sleep(1);
     }
   }
   else if (mode == _LK_UNLCK)
@@ -916,7 +907,7 @@
   if (!buf)
   {
     WARN(":failed-NULL buf\n");
-    MSVCRT__set_errno(ERROR_INVALID_PARAMETER);
+    msvcrt_set_errno(ERROR_INVALID_PARAMETER);
     return -1;
   }
 
@@ -925,7 +916,7 @@
   if (!GetFileInformationByHandle(hand, &hfi))
   {
     WARN(":failed-last error (%ld)\n",GetLastError());
-    MSVCRT__set_errno(ERROR_INVALID_PARAMETER);
+    msvcrt_set_errno(ERROR_INVALID_PARAMETER);
     return -1;
   }
   FIXME(":dwFileAttributes = %ld, mode set to 0\n",hfi.dwFileAttributes);
@@ -954,7 +945,7 @@
 /*********************************************************************
  *		_futime (MSVCRT.@)
  */
-int _futime(int fd, struct _utimbuf *t)
+int MSVCRT__futime(int fd, struct MSVCRT__utimbuf *t)
 {
   HANDLE hand = msvcrt_fdtoh(fd);
   FILETIME at, wt;
@@ -977,7 +968,7 @@
 
   if (!SetFileTime(hand, NULL, &at, &wt))
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1 ;
   }
   return 0;
@@ -1130,7 +1121,7 @@
       pmode = va_arg(ap, int);
     va_end(ap);
 
-    if(pmode & ~(_S_IREAD | _S_IWRITE))
+    if(pmode & ~(MSVCRT__S_IREAD | MSVCRT__S_IWRITE))
       FIXME(": pmode 0x%04x ignored\n", pmode);
     else
       WARN(": pmode 0x%04x ignored\n", pmode);
@@ -1200,7 +1191,7 @@
 
   if (hand == INVALID_HANDLE_VALUE)  {
     WARN(":failed-last error (%ld)\n",GetLastError());
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
 
@@ -1238,7 +1229,7 @@
     return retval;
   }
 
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -1282,7 +1273,7 @@
     return retval;
   }
 
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -1450,7 +1441,7 @@
 {
   DWORD dw;
   WIN32_FILE_ATTRIBUTE_DATA hfi;
-  unsigned short mode = MSVCRT_S_IREAD;
+  unsigned short mode = ALL_S_IREAD;
   int plen;
 
   TRACE(":file (%s) buf(%p)\n",path,buf);
@@ -1458,7 +1449,7 @@
   if (!GetFileAttributesExA(path, GetFileExInfoStandard, &hfi))
   {
       TRACE("failed (%ld)\n",GetLastError());
-      MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+      msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
       return -1;
   }
 
@@ -1479,22 +1470,22 @@
   /* Dir, or regular file? */
   if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
       (path[plen-1] == '\\'))
-    mode |= (_S_IFDIR | MSVCRT_S_IEXEC);
+    mode |= (MSVCRT__S_IFDIR | ALL_S_IEXEC);
   else
   {
-    mode |= _S_IFREG;
+    mode |= MSVCRT__S_IFREG;
     /* executable? */
     if (plen > 6 && path[plen-4] == '.')  /* shortest exe: "\x.exe" */
     {
       unsigned int ext = tolower(path[plen-1]) | (tolower(path[plen-2]) << 8) |
                                  (tolower(path[plen-3]) << 16);
       if (ext == EXE || ext == BAT || ext == CMD || ext == COM)
-          mode |= MSVCRT_S_IEXEC;
+          mode |= ALL_S_IEXEC;
     }
   }
 
   if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
-    mode |= MSVCRT_S_IWRITE;
+    mode |= ALL_S_IWRITE;
 
   buf->st_mode  = mode;
   buf->st_nlink = 1;
@@ -1529,7 +1520,7 @@
 {
   DWORD dw;
   WIN32_FILE_ATTRIBUTE_DATA hfi;
-  unsigned short mode = MSVCRT_S_IREAD;
+  unsigned short mode = ALL_S_IREAD;
   int plen;
 
   TRACE(":file (%s) buf(%p)\n",debugstr_w(path),buf);
@@ -1537,7 +1528,7 @@
   if (!GetFileAttributesExW(path, GetFileExInfoStandard, &hfi))
   {
       TRACE("failed (%ld)\n",GetLastError());
-      MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+      msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
       return -1;
   }
 
@@ -1554,22 +1545,22 @@
   /* Dir, or regular file? */
   if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
       (path[plen-1] == '\\'))
-    mode |= (_S_IFDIR | MSVCRT_S_IEXEC);
+    mode |= (MSVCRT__S_IFDIR | ALL_S_IEXEC);
   else
   {
-    mode |= _S_IFREG;
+    mode |= MSVCRT__S_IFREG;
     /* executable? */
     if (plen > 6 && path[plen-4] == '.')  /* shortest exe: "\x.exe" */
     {
       ULONGLONG ext = tolowerW(path[plen-1]) | (tolowerW(path[plen-2]) << 16) |
                                ((ULONGLONG)tolowerW(path[plen-3]) << 32);
       if (ext == WCEXE || ext == WCBAT || ext == WCCMD || ext == WCCOM)
-        mode |= MSVCRT_S_IEXEC;
+        mode |= ALL_S_IEXEC;
     }
   }
 
   if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
-    mode |= MSVCRT_S_IWRITE;
+    mode |= ALL_S_IWRITE;
 
   buf->st_mode  = mode;
   buf->st_nlink = 1;
@@ -1663,13 +1654,13 @@
 /*********************************************************************
  *		_utime (MSVCRT.@)
  */
-int _utime(const char* path, struct _utimbuf *t)
+int _utime(const char* path, struct MSVCRT__utimbuf *t)
 {
   int fd = _open(path, _O_WRONLY | _O_BINARY);
 
   if (fd > 0)
   {
-    int retVal = _futime(fd, t);
+    int retVal = MSVCRT__futime(fd, t);
     _close(fd);
     return retVal;
   }
@@ -1679,13 +1670,13 @@
 /*********************************************************************
  *		_wutime (MSVCRT.@)
  */
-int _wutime(const MSVCRT_wchar_t* path, struct _utimbuf *t)
+int _wutime(const MSVCRT_wchar_t* path, struct MSVCRT__utimbuf *t)
 {
   int fd = _wopen(path, _O_WRONLY | _O_BINARY);
 
   if (fd > 0)
   {
-    int retVal = _futime(fd, t);
+    int retVal = MSVCRT__futime(fd, t);
     _close(fd);
     return retVal;
   }
@@ -2074,7 +2065,7 @@
   if (msvcrt_get_flags(mode, &open_flags, &stream_flags) == -1)
       return NULL;
 
-  fd = _open(path, open_flags, _S_IREAD | _S_IWRITE);
+  fd = _open(path, open_flags, MSVCRT__S_IREAD | MSVCRT__S_IWRITE);
 
   if (fd < 0)
     return NULL;
@@ -2114,7 +2105,7 @@
     return retval;
   }
 
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return NULL;
 }
 
@@ -2250,7 +2241,7 @@
   if (msvcrt_get_flags(mode, &open_flags, &stream_flags) == -1)
       return NULL;
 
-  fd = _open(path, open_flags, _S_IREAD | _S_IWRITE);
+  fd = _open(path, open_flags, MSVCRT__S_IREAD | MSVCRT__S_IWRITE);
 
   if (fd < 0)
     return NULL;
@@ -2258,7 +2249,7 @@
   {
       file->_flag = 0;
       WARN(":failed-last error (%ld)\n",GetLastError());
-      MSVCRT__set_errno(GetLastError());
+      msvcrt_set_errno(GetLastError());
       return NULL;
   }
   return file;
@@ -2432,7 +2423,7 @@
   if (DeleteFileA(path))
     return 0;
   TRACE(":failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -2445,7 +2436,7 @@
   if (DeleteFileW(path))
     return 0;
   TRACE(":failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -2458,7 +2449,7 @@
   if (MoveFileExA(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
     return 0;
   TRACE(":failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -2471,7 +2462,7 @@
   if (MoveFileExW(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
     return 0;
   TRACE(":failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
Index: dlls/msvcrt/heap.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/heap.c,v
retrieving revision 1.14
diff -u -r1.14 heap.c
--- dlls/msvcrt/heap.c	20 Nov 2003 23:41:13 -0000	1.14
+++ dlls/msvcrt/heap.c	18 Jun 2004 04:56:36 -0000
@@ -22,12 +22,7 @@
  */
 
 #include "msvcrt.h"
-#include "msvcrt/errno.h"
-
-#include "msvcrt/malloc.h"
-#include "msvcrt/stdlib.h"
 #include "mtdll.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -46,7 +41,7 @@
 /*********************************************************************
  *		??2 at YAPAXI@Z (MSVCRT.@)
  */
-void* MSVCRT_operator_new(unsigned long size)
+void* msvcrt_operator_new(unsigned long size)
 {
   void *retval = HeapAlloc(GetProcessHeap(), 0, size);
   TRACE("(%ld) returning %p\n", size, retval);
@@ -60,7 +55,7 @@
 /*********************************************************************
  *		??3 at YAXPAX@Z (MSVCRT.@)
  */
-void MSVCRT_operator_delete(void *mem)
+void msvcrt_operator_delete(void *mem)
 {
   TRACE("(%p)\n", mem);
   HeapFree(GetProcessHeap(), 0, mem);
@@ -110,7 +105,7 @@
 /*********************************************************************
  *		?_set_new_mode@@YAHH at Z (MSVCRT.@)
  */
-int MSVCRT__set_new_mode(int mode)
+int msvcrt__set_new_mode(int mode)
 {
   int old_mode;
   LOCK_HEAP;
@@ -145,10 +140,10 @@
 {
   if (!HeapValidate( GetProcessHeap(), 0, NULL))
   {
-    MSVCRT__set_errno(GetLastError());
-    return _HEAPBADNODE;
+    msvcrt_set_errno(GetLastError());
+    return MSVCRT__HEAPBADNODE;
   }
-  return _HEAPOK;
+  return MSVCRT__HEAPOK;
 }
 
 /*********************************************************************
@@ -159,7 +154,7 @@
   if (!HeapCompact( GetProcessHeap(), 0 ))
   {
     if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
-      MSVCRT__set_errno(GetLastError());
+      msvcrt_set_errno(GetLastError());
     return -1;
   }
   return 0;
@@ -168,21 +163,21 @@
 /*********************************************************************
  *		_heapwalk (MSVCRT.@)
  */
-int _heapwalk(_HEAPINFO* next)
+int _heapwalk(struct MSVCRT__heapinfo* next)
 {
   PROCESS_HEAP_ENTRY phe;
 
   LOCK_HEAP;
   phe.lpData = next->_pentry;
   phe.cbData = next->_size;
-  phe.wFlags = next->_useflag == _USEDENTRY ? PROCESS_HEAP_ENTRY_BUSY : 0;
+  phe.wFlags = next->_useflag == MSVCRT__USEDENTRY ? PROCESS_HEAP_ENTRY_BUSY : 0;
 
   if (phe.lpData && phe.wFlags & PROCESS_HEAP_ENTRY_BUSY &&
       !HeapValidate( GetProcessHeap(), 0, phe.lpData ))
   {
     UNLOCK_HEAP;
-    MSVCRT__set_errno(GetLastError());
-    return _HEAPBADNODE;
+    msvcrt_set_errno(GetLastError());
+    return MSVCRT__HEAPBADNODE;
   }
 
   do
@@ -191,19 +186,19 @@
     {
       UNLOCK_HEAP;
       if (GetLastError() == ERROR_NO_MORE_ITEMS)
-         return _HEAPEND;
-      MSVCRT__set_errno(GetLastError());
+         return MSVCRT__HEAPEND;
+      msvcrt_set_errno(GetLastError());
       if (!phe.lpData)
-        return _HEAPBADBEGIN;
-      return _HEAPBADNODE;
+        return MSVCRT__HEAPBADBEGIN;
+      return MSVCRT__HEAPBADNODE;
     }
   } while (phe.wFlags & (PROCESS_HEAP_REGION|PROCESS_HEAP_UNCOMMITTED_RANGE));
 
   UNLOCK_HEAP;
   next->_pentry = phe.lpData;
   next->_size = phe.cbData;
-  next->_useflag = phe.wFlags & PROCESS_HEAP_ENTRY_BUSY ? _USEDENTRY : _FREEENTRY;
-  return _HEAPOK;
+  next->_useflag = phe.wFlags & PROCESS_HEAP_ENTRY_BUSY ? MSVCRT__USEDENTRY : MSVCRT__FREEENTRY;
+  return MSVCRT__HEAPOK;
 }
 
 /*********************************************************************
@@ -212,17 +207,17 @@
 int _heapset(unsigned int value)
 {
   int retval;
-  _HEAPINFO heap;
+  struct MSVCRT__heapinfo heap;
 
-  memset( &heap, 0, sizeof(_HEAPINFO) );
+  memset( &heap, 0, sizeof(heap) );
   LOCK_HEAP;
-  while ((retval = _heapwalk(&heap)) == _HEAPOK)
+  while ((retval = _heapwalk(&heap)) == MSVCRT__HEAPOK)
   {
-    if (heap._useflag == _FREEENTRY)
+    if (heap._useflag == MSVCRT__FREEENTRY)
       memset(heap._pentry, value, heap._size);
   }
   UNLOCK_HEAP;
-  return retval == _HEAPEND? _HEAPOK : retval;
+  return retval == MSVCRT__HEAPEND? MSVCRT__HEAPOK : retval;
 }
 
 /*********************************************************************
@@ -272,7 +267,7 @@
 {
   void *ret = HeapAlloc(GetProcessHeap(),0,size);
   if (!ret)
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
   return ret;
 }
 
Index: dlls/msvcrt/locale.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/locale.c,v
retrieving revision 1.22
diff -u -r1.22 locale.c
--- dlls/msvcrt/locale.c	13 Jan 2004 05:45:05 -0000	1.22
+++ dlls/msvcrt/locale.c	18 Jun 2004 04:33:40 -0000
@@ -30,7 +30,6 @@
 #include "winuser.h"
 
 #include "msvcrt.h"
-#include "msvcrt/locale.h"
 #include "mtdll.h"
 
 #include "wine/debug.h"
@@ -44,7 +43,7 @@
 #define MAX_LOCALE_LENGTH 256
 char MSVCRT_current_lc_all[MAX_LOCALE_LENGTH];
 LCID MSVCRT_current_lc_all_lcid;
-int MSVCRT_current_lc_all_cp;
+int msvcrt_current_lc_all_cp;
 
 /* MT */
 #define LOCK_LOCALE   _mlock(_SETLOCALE_LOCK);
@@ -275,7 +274,7 @@
     unsigned char *traverse = (unsigned char *)cp.LeadByte;
 
     memset(MSVCRT_current_ctype, 0, sizeof(MSVCRT__ctype));
-    MSVCRT_current_lc_all_cp = codepage;
+    msvcrt_current_lc_all_cp = codepage;
 
     /* Switch ctype macros to MBCS if needed */
     MSVCRT___mb_cur_max = cp.MaxCharSize;
@@ -342,7 +341,7 @@
   {
     MSVCRT_current_lc_all[0] = 'C';
     MSVCRT_current_lc_all[1] = '\0';
-    MSVCRT_current_lc_all_cp = GetACP();
+    msvcrt_current_lc_all_cp = GetACP();
 
     switch (category) {
     case MSVCRT_LC_ALL:
@@ -520,10 +519,10 @@
 void _setmbcp(int cp)
 {
   LOCK_LOCALE;
-  if (MSVCRT_current_lc_all_cp != cp)
+  if (msvcrt_current_lc_all_cp != cp)
   {
     /* FIXME: set ctype behaviour for this cp */
-    MSVCRT_current_lc_all_cp = cp;
+    msvcrt_current_lc_all_cp = cp;
   }
   UNLOCK_LOCALE;
 }
@@ -533,7 +532,7 @@
  */
 int _getmbcp(void)
 {
-  return MSVCRT_current_lc_all_cp;
+  return msvcrt_current_lc_all_cp;
 }
 
 /*********************************************************************
Index: dlls/msvcrt/main.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/main.c,v
retrieving revision 1.17
diff -u -r1.17 main.c
--- dlls/msvcrt/main.c	13 Jan 2004 22:56:59 -0000	1.17
+++ dlls/msvcrt/main.c	18 Jun 2004 04:33:40 -0000
@@ -19,15 +19,12 @@
  */
 #include "msvcrt.h"
 
-#include "msvcrt/locale.h"
-#include "msvcrt/stdio.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
 /* Index to TLS */
-DWORD MSVCRT_tls_index;
+DWORD msvcrt_tls_index;
 
 static inline BOOL msvcrt_init_tls(void);
 static inline BOOL msvcrt_free_tls(void);
@@ -38,12 +35,12 @@
  */
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 {
-  MSVCRT_thread_data *tls;
+  thread_data_t *tls;
 
   TRACE("(%p, %s, %p) pid(%lx), tid(%lx), tls(%ld)\n",
         hinstDLL, msvcrt_get_reason(fdwReason), lpvReserved,
         GetCurrentProcessId(), GetCurrentThreadId(),
-        (long)MSVCRT_tls_index);
+        (long)msvcrt_tls_index);
 
   switch (fdwReason)
   {
@@ -70,7 +67,7 @@
     break;
   case DLL_THREAD_DETACH:
     /* Free TLS */
-    tls = TlsGetValue(MSVCRT_tls_index);
+    tls = TlsGetValue(msvcrt_tls_index);
     if (tls) HeapFree(GetProcessHeap(), 0, tls);
     TRACE("finished thread free\n");
     break;
@@ -80,9 +77,9 @@
 
 static inline BOOL msvcrt_init_tls(void)
 {
-  MSVCRT_tls_index = TlsAlloc();
+  msvcrt_tls_index = TlsAlloc();
 
-  if (MSVCRT_tls_index == TLS_OUT_OF_INDEXES)
+  if (msvcrt_tls_index == TLS_OUT_OF_INDEXES)
   {
     ERR("TlsAlloc() failed!\n");
     return FALSE;
@@ -92,7 +89,7 @@
 
 static inline BOOL msvcrt_free_tls(void)
 {
-  if (!TlsFree(MSVCRT_tls_index))
+  if (!TlsFree(msvcrt_tls_index))
   {
     ERR("TlsFree() failed!\n");
     return FALSE;
@@ -140,9 +137,9 @@
  *  Success: A string pointing to the unmangled name, allocated with memget.
  *  Failure: NULL.
  */
-char* MSVCRT___unDNameEx(char * OutStr, const char* mangled, int OutStrLen,
-                       MSVCRT_malloc_func memget,
-                       MSVCRT_free_func memfree,
+char* msvcrt___unDNameEx(char * OutStr, const char* mangled, int OutStrLen,
+                       malloc_func_t memget,
+                       free_func_t memfree,
                        void * unknown,
                        unsigned short int flags)
 {
@@ -177,11 +174,11 @@
 /*********************************************************************
  *		__unDName (MSVCRT.@)
  */
-char* MSVCRT___unDName(char * OutStr, const char* mangled, int OutStrLen,
-                       MSVCRT_malloc_func memget,
-                       MSVCRT_free_func memfree,
+char* msvcrt___unDName(char * OutStr, const char* mangled, int OutStrLen,
+                       malloc_func_t memget,
+                       free_func_t memfree,
                        unsigned short int flags)
 {
-   return MSVCRT___unDNameEx( OutStr, mangled, OutStrLen, memget, memfree,
+   return msvcrt___unDNameEx( OutStr, mangled, OutStrLen, memget, memfree,
            NULL, flags);
 }
Index: dlls/msvcrt/math.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/math.c,v
retrieving revision 1.23
diff -u -r1.23 math.c
--- dlls/msvcrt/math.c	12 May 2004 23:22:36 -0000	1.23
+++ dlls/msvcrt/math.c	18 Jun 2004 04:33:40 -0000
@@ -28,9 +28,6 @@
 #endif
 
 #include "msvcrt.h"
-#include "msvcrt/errno.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/math.h"
 #include "msvcrt/float.h"
 
 #include "wine/debug.h"
@@ -654,7 +651,7 @@
  */
 char *_ecvt( double number, int ndigits, int *decpt, int *sign )
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
+    thread_data_t *data = msvcrt_get_thread_data();
     char *dec;
 
     if (!data->efcvt_buffer)
@@ -672,7 +669,7 @@
  */
 char *_fcvt( double number, int ndigits, int *decpt, int *sign )
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
+    thread_data_t *data = msvcrt_get_thread_data();
     char *dec;
 
     if (!data->efcvt_buffer)
Index: dlls/msvcrt/mbcs.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/mbcs.c,v
retrieving revision 1.27
diff -u -r1.27 mbcs.c
--- dlls/msvcrt/mbcs.c	17 Apr 2003 02:15:03 -0000	1.27
+++ dlls/msvcrt/mbcs.c	18 Jun 2004 04:33:40 -0000
@@ -24,13 +24,6 @@
  */
 
 #include "msvcrt.h"
-
-#include "msvcrt/mbctype.h"
-#include "msvcrt/mbstring.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-#include "msvcrt/wctype.h"
-
 #include "wine/unicode.h"
 #include "wine/debug.h"
 
@@ -53,7 +46,7 @@
     mbch[1] = ch & 0xff;
     n_chars = 2;
   }
-  if (!MultiByteToWideChar(MSVCRT_current_lc_all_cp, 0, mbch, n_chars, &chW, 1))
+  if (!MultiByteToWideChar(msvcrt_current_lc_all_cp, 0, mbch, n_chars, &chW, 1))
   {
     WARN("MultiByteToWideChar failed on %x\n", ch);
     return 0;
@@ -555,7 +548,7 @@
  */
 unsigned char* _mbstok(unsigned char *str, const unsigned char *delim)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
+    thread_data_t *data = msvcrt_get_thread_data();
     char *ret;
 
     if(MSVCRT___mb_cur_max > 1)
@@ -626,7 +619,7 @@
 int _ismbbkana(unsigned int c)
 {
   /* FIXME: use lc_ctype when supported, not lc_all */
-  if(MSVCRT_current_lc_all_cp == 932)
+  if(msvcrt_current_lc_all_cp == 932)
   {
     /* Japanese/Katakana, CP 932 */
     return (c >= 0xa1 && c <= 0xdf);
@@ -736,7 +729,7 @@
 int _ismbchira(unsigned int c)
 {
   /* FIXME: use lc_ctype when supported, not lc_all */
-  if(MSVCRT_current_lc_all_cp == 932)
+  if(msvcrt_current_lc_all_cp == 932)
   {
     /* Japanese/Hiragana, CP 932 */
     return (c >= 0x829f && c <= 0x82f1);
@@ -750,7 +743,7 @@
 int _ismbckata(unsigned int c)
 {
   /* FIXME: use lc_ctype when supported, not lc_all */
-  if(MSVCRT_current_lc_all_cp == 932)
+  if(msvcrt_current_lc_all_cp == 932)
   {
     if(c < 256)
       return _ismbbkana(c);
Index: dlls/msvcrt/misc.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/misc.c,v
retrieving revision 1.11
diff -u -r1.11 misc.c
--- dlls/msvcrt/misc.c	17 May 2004 21:08:31 -0000	1.11
+++ dlls/msvcrt/misc.c	18 Jun 2004 04:33:40 -0000
@@ -24,8 +24,6 @@
 #include <stdlib.h>
 
 #include "msvcrt.h"
-#include "msvcrt/stdlib.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
Index: dlls/msvcrt/msvcrt.h
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/msvcrt.h,v
retrieving revision 1.25
diff -u -r1.25 msvcrt.h
--- dlls/msvcrt/msvcrt.h	16 Mar 2004 19:17:11 -0000	1.25
+++ dlls/msvcrt/msvcrt.h	18 Jun 2004 04:53:17 -0000
@@ -28,38 +28,58 @@
 #include "winerror.h"
 #include "winnls.h"
 
-#include "msvcrt/string.h"
-#include "msvcrt/eh.h"
+typedef unsigned short MSVCRT_wchar_t;
+typedef unsigned short MSVCRT_wint_t;
+typedef unsigned short MSVCRT_wctype_t;
+typedef unsigned short MSVCRT__ino_t;
+typedef unsigned long  MSVCRT__fsize_t;
+typedef unsigned int   MSVCRT_size_t;
+typedef unsigned int   MSVCRT__dev_t;
+typedef int  MSVCRT__off_t;
+typedef long MSVCRT_clock_t;
+typedef long MSVCRT_time_t;
+typedef long MSVCRT_fpos_t;
+
+typedef void (*MSVCRT_terminate_handler)();
+typedef void (*MSVCRT_terminate_function)();
+typedef void (*MSVCRT_unexpected_handler)();
+typedef void (*MSVCRT_unexpected_function)();
+typedef void (*MSVCRT__se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info);
+typedef void (*MSVCRT__beginthread_start_routine_t)(void *);
+typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *);
+typedef int (*MSVCRT__onexit_t)(void);
+
 
 /* TLS data */
-extern DWORD MSVCRT_tls_index;
+extern DWORD msvcrt_tls_index;
 
-typedef struct __MSVCRT_thread_data
-{
-    int                      thread_errno;
-    unsigned long            thread_doserrno;
-    char                    *mbstok_next;        /* next ptr for mbstok() */
-    char                    *efcvt_buffer;       /* buffer for ecvt/fcvt */
-    int                      fpecode;
-    terminate_function       terminate_handler;
-    unexpected_function      unexpected_handler;
-    _se_translator_function  se_translator;
-    EXCEPTION_RECORD        *exc_record;
-} MSVCRT_thread_data;
+struct __thread_data {
+    int                             thread_errno;
+    unsigned long                   thread_doserrno;
+    char                           *mbstok_next;        /* next ptr for mbstok() */
+    char                           *efcvt_buffer;       /* buffer for ecvt/fcvt */
+    int                             fpecode;
+    MSVCRT_terminate_function       terminate_handler;
+    MSVCRT_unexpected_function      unexpected_handler;
+    MSVCRT__se_translator_function  se_translator;
+    EXCEPTION_RECORD               *exc_record;
+};
+
+typedef struct __thread_data thread_data_t;
 
-extern MSVCRT_thread_data *msvcrt_get_thread_data(void);
+extern thread_data_t *msvcrt_get_thread_data(void);
 
-extern int MSVCRT_current_lc_all_cp;
+extern int msvcrt_current_lc_all_cp;
 
-void _purecall(void);
-void   MSVCRT__set_errno(int);
+void   _purecall(void);
+void   msvcrt_set_errno(int);
 char*  msvcrt_strndup(const char*,unsigned int);
 MSVCRT_wchar_t *msvcrt_wstrndup(const MSVCRT_wchar_t*, unsigned int);
 
-void MSVCRT__amsg_exit(int errnum);
+void msvcrt__amsg_exit(int errnum);
 
-extern char **MSVCRT__environ;
-extern MSVCRT_wchar_t **MSVCRT__wenviron;
+extern char **msvcrt__environ;
+extern MSVCRT_wchar_t **msvcrt__wenviron;
 
 extern char ** msvcrt_SnapshotOfEnvironmentA(char **);
 extern MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **);
@@ -67,16 +87,16 @@
 /* FIXME: This should be declared in new.h but it's not an extern "C" so
  * it would not be much use anyway. Even for Winelib applications.
  */
-int    MSVCRT__set_new_mode(int mode);
+int    msvcrt__set_new_mode(int mode);
 
-void* MSVCRT_operator_new(unsigned long size);
-void MSVCRT_operator_delete(void*);
+void* msvcrt_operator_new(unsigned long size);
+void msvcrt_operator_delete(void*);
 
-typedef void* (*MSVCRT_malloc_func)(MSVCRT_size_t);
-typedef void (*MSVCRT_free_func)(void*);
+typedef void* (*malloc_func_t)(MSVCRT_size_t);
+typedef void (*free_func_t)(void*);
 
-extern char* MSVCRT___unDName(char *,const char*,int,MSVCRT_malloc_func,MSVCRT_free_func,unsigned short int);
-extern char* MSVCRT___unDNameEx(char *,const char*,int,MSVCRT_malloc_func,MSVCRT_free_func,void *,unsigned short int);
+extern char* msvcrt___unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int);
+extern char* msvcrt___unDNameEx(char *,const char*,int,malloc_func_t,free_func_t,void *,unsigned short int);
 
 /* Setup and teardown multi threaded locks */
 extern void msvcrt_init_mt_locks(void);
@@ -123,4 +143,355 @@
 #define _RT_CRNL        252
 #define _RT_BANNER      255
 
+struct MSVCRT_tm {
+    int tm_sec;
+    int tm_min;
+    int tm_hour;
+    int tm_mday;
+    int tm_mon;
+    int tm_year;
+    int tm_wday;
+    int tm_yday;
+    int tm_isdst;
+};
+
+struct MSVCRT__timeb {
+    MSVCRT_time_t  time;
+    unsigned short millitm;
+    short          timezone;
+    short          dstflag;
+};
+
+struct MSVCRT__iobuf {
+  char* _ptr;
+  int   _cnt;
+  char* _base;
+  int   _flag;
+  int   _file;
+  int   _charbuf;
+  int   _bufsiz;
+  char* _tmpfname;
+};
+
+typedef struct MSVCRT__iobuf MSVCRT_FILE;
+
+struct MSVCRT_lconv {
+    char* decimal_point;
+    char* thousands_sep;
+    char* grouping;
+    char* int_curr_symbol;
+    char* currency_symbol;
+    char* mon_decimal_point;
+    char* mon_thousands_sep;
+    char* mon_grouping;
+    char* positive_sign;
+    char* negative_sign;
+    char int_frac_digits;
+    char frac_digits;
+    char p_cs_precedes;
+    char p_sep_by_space;
+    char n_cs_precedes;
+    char n_sep_by_space;
+    char p_sign_posn;
+    char n_sign_posn;
+};
+
+struct MSVCRT__exception {
+  int     type;
+  char*   name;
+  double  arg1;
+  double  arg2;
+  double  retval;
+};
+
+struct MSVCRT__complex {
+  double x;      /* Real part */
+  double y;      /* Imaginary part */
+};
+
+struct MSVCRT__heapinfo {
+  int*           _pentry;
+  MSVCRT_size_t  _size;
+  int            _useflag;
+};
+
+#ifdef __i386__
+struct MSVCRT___JUMP_BUFFER {
+    unsigned long Ebp;
+    unsigned long Ebx;
+    unsigned long Edi;
+    unsigned long Esi;
+    unsigned long Esp;
+    unsigned long Eip;
+    unsigned long Registration;
+    unsigned long TryLevel;
+    /* Start of new struct members */
+    unsigned long Cookie;
+    unsigned long UnwindFunc;
+    unsigned long UnwindData[6];
+};
+#endif /* __i386__ */
+
+struct MSVCRT__diskfree_t {
+  unsigned int total_clusters;
+  unsigned int avail_clusters;
+  unsigned int sectors_per_cluster;
+  unsigned int bytes_per_sector;
+};
+
+struct MSVCRT__finddata_t {
+  unsigned attrib;
+  MSVCRT_time_t   time_create;
+  MSVCRT_time_t   time_access;
+  MSVCRT_time_t   time_write;
+  MSVCRT__fsize_t size;
+  char            name[260];
+};
+
+struct MSVCRT__finddatai64_t {
+  unsigned attrib;
+  MSVCRT_time_t  time_create;
+  MSVCRT_time_t  time_access;
+  MSVCRT_time_t  time_write;
+  __int64        size;
+  char           name[260];
+};
+
+struct MSVCRT__wfinddata_t {
+  unsigned attrib;
+  MSVCRT_time_t   time_create;
+  MSVCRT_time_t   time_access;
+  MSVCRT_time_t   time_write;
+  MSVCRT__fsize_t size;
+  MSVCRT_wchar_t  name[260];
+};
+
+struct MSVCRT__wfinddatai64_t {
+  unsigned attrib;
+  MSVCRT_time_t   time_create;
+  MSVCRT_time_t   time_access;
+  MSVCRT_time_t   time_write;
+  __int64         size;
+  MSVCRT_wchar_t  name[260];
+};
+
+struct MSVCRT__utimbuf
+{
+    MSVCRT_time_t actime;
+    MSVCRT_time_t modtime;
+};
+
+/* for FreeBSD */
+#undef st_atime
+#undef st_ctime
+#undef st_mtime
+
+struct MSVCRT__stat {
+  MSVCRT__dev_t  st_dev;
+  MSVCRT__ino_t  st_ino;
+  unsigned short st_mode;
+  short          st_nlink;
+  short          st_uid;
+  short          st_gid;
+  MSVCRT__dev_t  st_rdev;
+  MSVCRT__off_t  st_size;
+  MSVCRT_time_t  st_atime;
+  MSVCRT_time_t  st_mtime;
+  MSVCRT_time_t  st_ctime;
+};
+
+struct MSVCRT_stat {
+  MSVCRT__dev_t  st_dev;
+  MSVCRT__ino_t  st_ino;
+  unsigned short st_mode;
+  short          st_nlink;
+  short          st_uid;
+  short          st_gid;
+  MSVCRT__dev_t  st_rdev;
+  MSVCRT__off_t  st_size;
+  MSVCRT_time_t  st_atime;
+  MSVCRT_time_t  st_mtime;
+  MSVCRT_time_t  st_ctime;
+};
+
+struct MSVCRT__stati64 {
+  MSVCRT__dev_t  st_dev;
+  MSVCRT__ino_t  st_ino;
+  unsigned short st_mode;
+  short          st_nlink;
+  short          st_uid;
+  short          st_gid;
+  MSVCRT__dev_t  st_rdev;
+  __int64        st_size;
+  MSVCRT_time_t  st_atime;
+  MSVCRT_time_t  st_mtime;
+  MSVCRT_time_t  st_ctime;
+};
+
+#define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
+#define MSVCRT_EOF       (-1)
+#define MSVCRT_TMP_MAX   0x7fff
+#define MSVCRT_BUFSIZ    512
+
+#define MSVCRT_STDIN_FILENO  0
+#define MSVCRT_STDOUT_FILENO 1
+#define MSVCRT_STDERR_FILENO 2
+
+/* more file._flag flags, but these conflict with Unix */
+#define MSVCRT__IOFBF    0x0000
+#define MSVCRT__IONBF    0x0004
+#define MSVCRT__IOLBF    0x0040
+
+#define MSVCRT_FILENAME_MAX 260
+#define MSVCRT_stdin       (MSVCRT__iob+MSVCRT_STDIN_FILENO)
+#define MSVCRT_stdout      (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
+#define MSVCRT_stderr      (MSVCRT__iob+MSVCRT_STDERR_FILENO)
+
+#define MSVCRT__P_WAIT    0
+#define MSVCRT__P_NOWAIT  1
+#define MSVCRT__P_OVERLAY 2
+#define MSVCRT__P_NOWAITO 3
+#define MSVCRT__P_DETACH  4
+
+#define MSVCRT_EPERM   1
+#define MSVCRT_ENOENT  2
+#define MSVCRT_ESRCH   3
+#define MSVCRT_EINTR   4
+#define MSVCRT_EIO     5
+#define MSVCRT_ENXIO   6
+#define MSVCRT_E2BIG   7
+#define MSVCRT_ENOEXEC 8
+#define MSVCRT_EBADF   9
+#define MSVCRT_ECHILD  10
+#define MSVCRT_EAGAIN  11
+#define MSVCRT_ENOMEM  12
+#define MSVCRT_EACCES  13
+#define MSVCRT_EFAULT  14
+#define MSVCRT_EBUSY   16
+#define MSVCRT_EEXIST  17
+#define MSVCRT_EXDEV   18
+#define MSVCRT_ENODEV  19
+#define MSVCRT_ENOTDIR 20
+#define MSVCRT_EISDIR  21
+#define MSVCRT_EINVAL  22
+#define MSVCRT_ENFILE  23
+#define MSVCRT_EMFILE  24
+#define MSVCRT_ENOTTY  25
+#define MSVCRT_EFBIG   27
+#define MSVCRT_ENOSPC  28
+#define MSVCRT_ESPIPE  29
+#define MSVCRT_EROFS   30
+#define MSVCRT_EMLINK  31
+#define MSVCRT_EPIPE   32
+#define MSVCRT_EDOM    33
+#define MSVCRT_ERANGE  34
+#define MSVCRT_EDEADLK 36
+#define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
+#define MSVCRT_ENAMETOOLONG 38
+#define MSVCRT_ENOLCK  39
+#define MSVCRT_ENOSYS  40
+#define MSVCRT_ENOTEMPTY 41
+
+#define MSVCRT_LC_ALL          0
+#define MSVCRT_LC_COLLATE      1
+#define MSVCRT_LC_CTYPE        2
+#define MSVCRT_LC_MONETARY     3
+#define MSVCRT_LC_NUMERIC      4
+#define MSVCRT_LC_TIME         5
+#define MSVCRT_LC_MIN          MSVCRT_LC_ALL
+#define MSVCRT_LC_MAX          MSVCRT_LC_TIME
+
+#define MSVCRT__HEAPEMPTY      -1
+#define MSVCRT__HEAPOK         -2
+#define MSVCRT__HEAPBADBEGIN   -3
+#define MSVCRT__HEAPBADNODE    -4
+#define MSVCRT__HEAPEND        -5
+#define MSVCRT__HEAPBADPTR     -6
+
+#define MSVCRT__FREEENTRY      0
+#define MSVCRT__USEDENTRY      1
+
+#define MSVCRT__OUT_TO_DEFAULT 0
+#define MSVCRT__REPORT_ERRMODE 3
+
+/* ASCII char classification table - binary compatible */
+#define MSVCRT__UPPER    0x0001  /* C1_UPPER */
+#define MSVCRT__LOWER    0x0002  /* C1_LOWER */
+#define MSVCRT__DIGIT    0x0004  /* C1_DIGIT */
+#define MSVCRT__SPACE    0x0008  /* C1_SPACE */
+#define MSVCRT__PUNCT    0x0010  /* C1_PUNCT */
+#define MSVCRT__CONTROL  0x0020  /* C1_CNTRL */
+#define MSVCRT__BLANK    0x0040  /* C1_BLANK */
+#define MSVCRT__HEX      0x0080  /* C1_XDIGIT */
+#define MSVCRT__LEADBYTE 0x8000
+#define MSVCRT__ALPHA   (0x0100|MSVCRT__UPPER|MSVCRT__LOWER)  /* (C1_ALPHA|_UPPER|_LOWER) */
+
+#define MSVCRT__IOREAD   0x0001
+#define MSVCRT__IOWRT    0x0002
+#define MSVCRT__IOMYBUF  0x0008
+#define MSVCRT__IOEOF    0x0010
+#define MSVCRT__IOERR    0x0020
+#define MSVCRT__IOSTRG   0x0040
+#define MSVCRT__IORW     0x0080
+
+#define MSVCRT__S_IEXEC  0x0040
+#define MSVCRT__S_IWRITE 0x0080
+#define MSVCRT__S_IREAD  0x0100
+#define MSVCRT__S_IFIFO  0x1000
+#define MSVCRT__S_IFCHR  0x2000
+#define MSVCRT__S_IFDIR  0x4000
+#define MSVCRT__S_IFREG  0x8000
+#define MSVCRT__S_IFMT   0xF000
+
+void           MSVCRT_free(void*);
+void*          MSVCRT_malloc(MSVCRT_size_t);
+void*          MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t);
+void*          MSVCRT_realloc(void*,MSVCRT_size_t);
+
+int            MSVCRT_iswalpha(MSVCRT_wint_t);
+int            MSVCRT_iswspace(MSVCRT_wint_t);
+int            MSVCRT_iswdigit(MSVCRT_wint_t);
+int            MSVCRT_isleadbyte(int);
+
+int            MSVCRT_fgetc(MSVCRT_FILE*);
+int            MSVCRT_ungetc(int,MSVCRT_FILE*);
+MSVCRT_wint_t  MSVCRT_fgetwc(MSVCRT_FILE*);
+MSVCRT_wint_t  MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);
+void           MSVCRT__exit(int);
+void           MSVCRT_abort();
+unsigned long* MSVCRT___doserrno(void);
+int*           MSVCRT__errno(void);
+char*          MSVCRT_getenv(const char*);
+char*          MSVCRT_setlocale(int,const char*);
+int            MSVCRT_fclose(MSVCRT_FILE*);
+void           MSVCRT_terminate();
+int            MSVCRT__futime(int,struct MSVCRT__utimbuf*);
+MSVCRT_FILE*   MSVCRT__p__iob(void);
+MSVCRT_time_t  MSVCRT_time(MSVCRT_time_t*);
+
+MSVCRT_wchar_t*   _wcsdup(const MSVCRT_wchar_t*);
+MSVCRT_wchar_t*** __p__wenviron(void);
+
+int            _write(int,const void*,unsigned int);
+int            _vsnwprintf(MSVCRT_wchar_t*,MSVCRT_size_t,const MSVCRT_wchar_t*,va_list);
+void           _splitpath(const char*,char*,char*,char*,char*);
+int            _ismbstrail(const unsigned char* start, const unsigned char* str);
+int            _spawnve(int,const char*,const char* const *,const char* const *);
+void           _searchenv(const char*,const char*,char*);
+int            _getdrive(void);
+char*          _strdup(const char*);
+char*          _strlwr(char*);
+char*          _strupr(char*);
+char*          _strnset(char*,int,MSVCRT_size_t);
+char*          _strset(char*,int);
+int            _getch(void);
+int            _ungetch(int);
+int            _cputs(const char*);
+int            _cprintf(const char*,...);
+int            _snprintf(char*,MSVCRT_size_t,const char*,...);
+
+char***        __p__environ(void);
+int*           __p___mb_cur_max(void);
+unsigned int*  __p__fmode(void);
+
 #endif /* __WINE_MSVCRT_H */
Index: dlls/msvcrt/msvcrt.spec
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/msvcrt.spec,v
retrieving revision 1.91
diff -u -r1.91 msvcrt.spec
--- dlls/msvcrt/msvcrt.spec	2 Jun 2004 00:35:09 -0000	1.91
+++ dlls/msvcrt/msvcrt.spec	18 Jun 2004 04:30:00 -0000
@@ -15,10 +15,10 @@
 @ cdecl -i386 -norelay ??1bad_typeid@@UAE at XZ() __thiscall_MSVCRT_bad_typeid_dtor
 @ cdecl -i386 -norelay ??1exception@@UAE at XZ() __thiscall_MSVCRT_exception_dtor
 @ cdecl -i386 -norelay ??1type_info@@UAE at XZ() __thiscall_MSVCRT_type_info_dtor
-@ cdecl ??2 at YAPAXI@Z(long) MSVCRT_operator_new
-@ cdecl ??_U at YAPAXI@Z(long) MSVCRT_operator_new
-@ cdecl ??3 at YAXPAX@Z(ptr) MSVCRT_operator_delete
-@ cdecl ??_V at YAXPAX@Z(ptr) MSVCRT_operator_delete
+@ cdecl ??2 at YAPAXI@Z(long) msvcrt_operator_new
+@ cdecl ??_U at YAPAXI@Z(long) msvcrt_operator_new
+@ cdecl ??3 at YAXPAX@Z(ptr) msvcrt_operator_delete
+@ cdecl ??_V at YAXPAX@Z(ptr) msvcrt_operator_delete
 @ cdecl -i386 -norelay ??4__non_rtti_object@@QAEAAV0 at ABV0@@Z(ptr) __thiscall_MSVCRT___non_rtti_object_opequals
 @ cdecl -i386 -norelay ??4bad_cast@@QAEAAV0 at ABV0@@Z(ptr) __thiscall_MSVCRT_bad_cast_opequals
 @ cdecl -i386 -norelay ??4bad_typeid@@QAEAAV0 at ABV0@@Z(ptr) __thiscall_MSVCRT_bad_typeid_opequals
@@ -40,7 +40,7 @@
 @ cdecl ?_query_new_handler@@YAP6AHI at ZXZ() MSVCRT__query_new_handler
 @ cdecl ?_query_new_mode@@YAHXZ() MSVCRT__query_new_mode
 @ cdecl ?_set_new_handler@@YAP6AHI at ZP6AHI@Z at Z(ptr) MSVCRT__set_new_handler
-@ cdecl ?_set_new_mode@@YAHH at Z(long) MSVCRT__set_new_mode
+@ cdecl ?_set_new_mode@@YAHH at Z(long) msvcrt__set_new_mode
 @ cdecl ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0 at Z@Z(ptr) MSVCRT__set_se_translator
 @ cdecl -i386 -norelay ?before at type_info@@QBEHABV1@@Z(ptr) __thiscall_MSVCRT_type_info_before
 @ cdecl -i386 -norelay ?name at type_info@@QBEPBDXZ() __thiscall_MSVCRT_type_info_name
@@ -137,8 +137,8 @@
 @ cdecl __threadhandle() kernel32.GetCurrentThread
 @ cdecl __threadid() kernel32.GetCurrentThreadId
 @ cdecl __toascii(long) MSVCRT___toascii
-@ cdecl __unDName(ptr str long ptr ptr long) MSVCRT___unDName
-@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) MSVCRT___unDNameEx
+@ cdecl __unDName(ptr str long ptr ptr long) msvcrt___unDName
+@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) msvcrt___unDNameEx
 @ extern __unguarded_readlc_active MSVCRT___unguarded_readlc_active
 @ extern __wargv MSVCRT___wargv
 @ cdecl __wgetmainargs(ptr ptr ptr long ptr)
@@ -161,7 +161,7 @@
 @ cdecl _adj_fptan()
 @ cdecl _adjust_fdiv()
 @ extern _aexit_rtn
-@ cdecl _amsg_exit(long) MSVCRT__amsg_exit
+@ cdecl _amsg_exit(long) msvcrt__amsg_exit
 @ cdecl _assert(str str long) MSVCRT__assert
 @ stub _atodbl #(ptr str)
 @ cdecl -ret64 _atoi64(str) ntdll._atoi64
@@ -200,7 +200,7 @@
 @ cdecl _ecvt(double long ptr ptr)
 @ cdecl _endthread ()
 @ cdecl _endthreadex(long)
-@ extern _environ MSVCRT__environ
+@ extern _environ msvcrt__environ
 @ cdecl _eof(long)
 @ cdecl _errno() MSVCRT__errno
 @ cdecl _except_handler2(ptr ptr ptr ptr)
@@ -245,7 +245,7 @@
 @ cdecl _ftime(ptr)
 @ cdecl -ret64 _ftol() ntdll._ftol
 @ cdecl _fullpath(ptr str long)
-@ cdecl _futime(long ptr)
+@ cdecl _futime(long ptr) MSVCRT__futime
 @ cdecl _gcvt(double long str)
 @ cdecl _get_osfhandle(long)
 @ stub _get_sbh_threshold #()
@@ -504,7 +504,7 @@
 @ cdecl _wcsset(wstr long)
 @ cdecl _wcsupr(wstr) ntdll._wcsupr
 @ stub _wctime #(ptr)
-@ extern _wenviron MSVCRT__wenviron
+@ extern _wenviron msvcrt__wenviron
 @ stub _wexecl #(wstr wstr) varargs
 @ stub _wexecle #(wstr wstr) varargs
 @ stub _wexeclp #(wstr wstr) varargs
Index: dlls/msvcrt/process.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/process.c,v
retrieving revision 1.23
diff -u -r1.23 process.c
--- dlls/msvcrt/process.c	9 Apr 2004 19:03:13 -0000	1.23
+++ dlls/msvcrt/process.c	18 Jun 2004 04:33:40 -0000
@@ -30,13 +30,6 @@
 #include <stdarg.h>
 
 #include "msvcrt.h"
-#include "msvcrt/errno.h"
-
-#include "msvcrt/stdio.h"
-#include "msvcrt/process.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -50,7 +43,7 @@
   if (sizeof(HANDLE) != sizeof(int))
     WARN("This call is unsuitable for your architecture\n");
 
-  if ((unsigned)flags > _P_DETACH)
+  if ((unsigned)flags > MSVCRT__P_DETACH)
   {
     *MSVCRT__errno() = MSVCRT_EINVAL;
     return -1;
@@ -62,30 +55,30 @@
   si.cb = sizeof(si);
 
   if (!CreateProcessA(exe, cmdline, NULL, NULL, TRUE,
-                     flags == _P_DETACH ? DETACHED_PROCESS : 0,
+                     flags == MSVCRT__P_DETACH ? DETACHED_PROCESS : 0,
                      env, NULL, &si, &pi))
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
 
   switch(flags)
   {
-  case _P_WAIT:
+  case MSVCRT__P_WAIT:
     WaitForSingleObject(pi.hProcess, INFINITE);
     GetExitCodeProcess(pi.hProcess,&pi.dwProcessId);
     CloseHandle(pi.hProcess);
     CloseHandle(pi.hThread);
     return (int)pi.dwProcessId;
-  case _P_DETACH:
+  case MSVCRT__P_DETACH:
     CloseHandle(pi.hProcess);
     pi.hProcess = 0;
     /* fall through */
-  case _P_NOWAIT:
-  case _P_NOWAITO:
+  case MSVCRT__P_NOWAIT:
+  case MSVCRT__P_NOWAITO:
     CloseHandle(pi.hThread);
     return (int)pi.hProcess;
-  case  _P_OVERLAY:
+  case  MSVCRT__P_OVERLAY:
     MSVCRT__exit(0);
   }
   return -1; /* can't reach here */
@@ -218,7 +211,7 @@
     *MSVCRT___doserrno() = doserrno;
   }
   else
-    MSVCRT__set_errno(doserrno);
+    msvcrt_set_errno(doserrno);
 
   return status ? *status = -1 : -1;
 }
@@ -239,7 +232,7 @@
   args = msvcrt_valisttos(arg0, ap, ' ');
   va_end(ap);
 
-  ret = msvcrt_spawn(_P_OVERLAY, name, args, NULL);
+  ret = msvcrt_spawn(MSVCRT__P_OVERLAY, name, args, NULL);
   MSVCRT_free(args);
 
   return ret;
@@ -273,7 +266,7 @@
   args = msvcrt_valisttos(arg0, ap, ' ');
   va_end(ap);
 
-  ret = msvcrt_spawn(_P_OVERLAY, fullname[0] ? fullname : name, args, NULL);
+  ret = msvcrt_spawn(MSVCRT__P_OVERLAY, fullname[0] ? fullname : name, args, NULL);
   MSVCRT_free(args);
 
   return ret;
@@ -296,7 +289,7 @@
  */
 int _execv(const char* name, char* const* argv)
 {
-  return _spawnve(_P_OVERLAY, name, (const char* const*) argv, NULL);
+  return _spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, NULL);
 }
 
 /*********************************************************************
@@ -307,7 +300,7 @@
  */
 int _execve(const char* name, char* const* argv, const char* const* envv)
 {
-  return _spawnve(_P_OVERLAY, name, (const char* const*) argv, envv);
+  return _spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, envv);
 }
 
 /*********************************************************************
@@ -321,7 +314,7 @@
   char fullname[MAX_PATH];
 
   _searchenv(name, "PATH", fullname);
-  return _spawnve(_P_OVERLAY, fullname[0] ? fullname : name,
+  return _spawnve(MSVCRT__P_OVERLAY, fullname[0] ? fullname : name,
                   (const char* const*) argv, envv);
 }
 
@@ -504,7 +497,7 @@
     /* Make a writable copy for CreateProcess */
     cmdcopy=_strdup(cmd);
     /* FIXME: should probably launch cmd interpreter in COMSPEC */
-    res=msvcrt_spawn(_P_WAIT, NULL, cmdcopy, NULL);
+    res=msvcrt_spawn(MSVCRT__P_WAIT, NULL, cmdcopy, NULL);
     MSVCRT_free(cmdcopy);
     return res;
 }
@@ -527,7 +520,7 @@
   else
   {
     int err = GetLastError();
-    MSVCRT__set_errno(err);
+    msvcrt_set_errno(err);
     return err;
   }
 }
Index: dlls/msvcrt/scanf.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/scanf.c,v
retrieving revision 1.6
diff -u -r1.6 scanf.c
--- dlls/msvcrt/scanf.c	19 Feb 2004 01:13:13 -0000	1.6
+++ dlls/msvcrt/scanf.c	18 Jun 2004 04:33:40 -0000
@@ -30,10 +30,6 @@
 #include "winreg.h"
 #include "winternl.h"
 #include "msvcrt.h"
-#include "msvcrt/conio.h"
-#include "msvcrt/io.h"
-#include "msvcrt/stdio.h"
-#include "msvcrt/wctype.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
Index: dlls/msvcrt/string.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/string.c,v
retrieving revision 1.9
diff -u -r1.9 string.c
--- dlls/msvcrt/string.c	16 Mar 2004 19:17:11 -0000	1.9
+++ dlls/msvcrt/string.c	18 Jun 2004 04:33:40 -0000
@@ -22,9 +22,6 @@
  */
 
 #include "msvcrt.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
Index: dlls/msvcrt/thread.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/thread.c,v
retrieving revision 1.12
diff -u -r1.12 thread.c
--- dlls/msvcrt/thread.c	25 Oct 2002 03:12:01 -0000	1.12
+++ dlls/msvcrt/thread.c	18 Jun 2004 04:33:40 -0000
@@ -18,10 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include "msvcrt.h"
-
-#include "msvcrt/malloc.h"
-#include "msvcrt/process.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -29,7 +25,7 @@
 /********************************************************************/
 
 typedef struct {
-  _beginthread_start_routine_t start_address;
+  MSVCRT__beginthread_start_routine_t start_address;
   void *arglist;
 } _beginthread_trampoline_t;
 
@@ -38,16 +34,16 @@
  *
  * Return the thread local storage structure.
  */
-MSVCRT_thread_data *msvcrt_get_thread_data(void)
+thread_data_t *msvcrt_get_thread_data(void)
 {
-    MSVCRT_thread_data *ptr;
+    thread_data_t *ptr;
     DWORD err = GetLastError();  /* need to preserve last error */
 
-    if (!(ptr = TlsGetValue( MSVCRT_tls_index )))
+    if (!(ptr = TlsGetValue( msvcrt_tls_index )))
     {
         if (!(ptr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ptr) )))
-            MSVCRT__amsg_exit( _RT_THREAD );
-        if (!TlsSetValue( MSVCRT_tls_index, ptr )) MSVCRT__amsg_exit( _RT_THREAD );
+            msvcrt__amsg_exit( _RT_THREAD );
+        if (!TlsSetValue( msvcrt_tls_index, ptr )) msvcrt__amsg_exit( _RT_THREAD );
     }
     SetLastError( err );
     return ptr;
@@ -75,7 +71,7 @@
  *		_beginthread (MSVCRT.@)
  */
 unsigned long _beginthread(
-  _beginthread_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
+  MSVCRT__beginthread_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
   unsigned int stack_size, /* [in] Stack size for new thread or 0 */
   void *arglist)           /* [in] Argument list to be passed to new thread or NULL */
 {
@@ -102,7 +98,7 @@
 unsigned long _beginthreadex(
   void *security,          /* [in] Security descriptor for new thread; must be NULL for Windows 9x applications */
   unsigned int stack_size, /* [in] Stack size for new thread or 0 */
-  _beginthreadex_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
+  MSVCRT__beginthreadex_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
   void *arglist,           /* [in] Argument list to be passed to new thread or NULL */
   unsigned int initflag,   /* [in] Initial state of new thread (0 for running or CREATE_SUSPEND for suspended) */
   unsigned int *thrdaddr)  /* [out] Points to a 32-bit variable that receives the thread identifier */
Index: dlls/msvcrt/time.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/time.c,v
retrieving revision 1.14
diff -u -r1.14 time.c
--- dlls/msvcrt/time.c	25 Mar 2004 00:12:40 -0000	1.14
+++ dlls/msvcrt/time.c	18 Jun 2004 04:33:40 -0000
@@ -30,11 +30,7 @@
 #endif
 
 #include "msvcrt.h"
-#include "msvcrt/sys/timeb.h"
-#include "msvcrt/time.h"
-
 #include "winbase.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -221,23 +217,9 @@
 }
 
 /*********************************************************************
- *		time (MSVCRT.@)
- */
-MSVCRT_time_t MSVCRT_time(MSVCRT_time_t* buf)
-{
-  MSVCRT_time_t curtime;
-  struct _timeb tb;
-
-  _ftime(&tb);
-
-  curtime = tb.time;
-  return buf ? *buf = curtime : curtime;
-}
-
-/*********************************************************************
  *		_ftime (MSVCRT.@)
  */
-void _ftime(struct _timeb *buf)
+void _ftime(struct MSVCRT__timeb *buf)
 {
   TIME_ZONE_INFORMATION tzinfo;
   FILETIME ft;
@@ -255,6 +237,20 @@
 }
 
 /*********************************************************************
+ *		time (MSVCRT.@)
+ */
+MSVCRT_time_t MSVCRT_time(MSVCRT_time_t* buf)
+{
+  MSVCRT_time_t curtime;
+  struct MSVCRT__timeb tb;
+
+  _ftime(&tb);
+
+  curtime = tb.time;
+  return buf ? *buf = curtime : curtime;
+}
+
+/*********************************************************************
  *		_daylight (MSVCRT.@)
  */
 int MSVCRT___daylight = 1; /* FIXME: assume daylight */
Index: dlls/msvcrt/wcs.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/wcs.c,v
retrieving revision 1.17
diff -u -r1.17 wcs.c
--- dlls/msvcrt/wcs.c	2 Jun 2004 00:35:09 -0000	1.17
+++ dlls/msvcrt/wcs.c	18 Jun 2004 04:33:40 -0000
@@ -24,12 +24,6 @@
 #include "msvcrt.h"
 #include "winnls.h"
 #include "wine/unicode.h"
-
-#include "msvcrt/stdio.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-#include "msvcrt/wctype.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
Index: dlls/msvcrt/tests/Makefile.in
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/tests/Makefile.in,v
retrieving revision 1.6
diff -u -r1.6 Makefile.in
--- dlls/msvcrt/tests/Makefile.in	25 Mar 2004 00:12:40 -0000	1.6
+++ dlls/msvcrt/tests/Makefile.in	16 Jun 2004 05:31:43 -0000
@@ -4,11 +4,13 @@
 VPATH     = @srcdir@
 TESTDLL   = msvcrt.dll
 IMPORTS   = msvcrt
-EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt
+EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt -I$(SRCDIR)/..
 
 CTESTS = \
 	cpp.c \
 	file.c \
+	headers.c \
 	heap.c \
 	scanf.c \
 	string.c \
@@ -16,4 +18,6 @@
 
 @MAKE_TEST_RULES@
 
+headers.c: test-gen $(SRCDIR)/../msvcrt.h
+
 ### Dependencies:
--- /dev/null	2004-02-23 16:02:56.000000000 -0500
+++ dlls/msvcrt/tests/headers.c	2004-06-18 01:44:43.339714008 -0400
@@ -0,0 +1,397 @@
+/* Automatically generated test. Do not edit. */
+#define USE_MSVCRT_PREFIX
+#include "dos.h"
+#include "math.h"
+#include "stdlib.h"
+#include "eh.h"
+#include "io.h"
+#include "errno.h"
+#include "unistd.h"
+#include "fcntl.h"
+#include "malloc.h"
+#include "limits.h"
+#include "mbctype.h"
+#include "stdio.h"
+#include "wchar.h"
+#include "ctype.h"
+#include "crtdbg.h"
+#include "share.h"
+#include "search.h"
+#include "wctype.h"
+#include "float.h"
+#include "stddef.h"
+#include "mbstring.h"
+#include "sys/unistd.h"
+#include "sys/locking.h"
+#include "sys/utime.h"
+#include "sys/types.h"
+#include "sys/stat.h"
+#include "sys/timeb.h"
+#include "direct.h"
+#include "conio.h"
+#include "dirent.h"
+#include "process.h"
+#include "string.h"
+#include "time.h"
+#include "locale.h"
+#include "setjmp.h"
+#include "msvcrt.h"
+#include "wine/test.h"
+
+#ifdef __GNUC__
+#define TYPEOF(type) typeof(type)
+#else
+#define TYPEOF(type) int
+#endif
+#define MSVCRT(x)    MSVCRT_##x
+#define OFFSET(T,F) ((unsigned int)((char *)&((struct T *)0L)->F - (char *)0L))
+#define CHECK_SIZE(e) ok(sizeof(e) == sizeof(MSVCRT(e)), "Element has different sizes\n")
+#define CHECK_TYPE(t) { TYPEOF(t) a = 0; TYPEOF(MSVCRT(t)) b = 0; a = b; CHECK_SIZE(t); }
+#define CHECK_STRUCT(s) ok(sizeof(struct s) == sizeof(struct MSVCRT(s)), "Struct has different sizes\n")
+#define CHECK_FIELD(s,e) ok(OFFSET(s,e) == OFFSET(MSVCRT(s),e), "Bad offset\n")
+#define CHECK_DEF(n,d1,d2) ok(d1 == d2, "Defines (MSVCRT_)%s are different: '%d' vs. '%d'\n", n, d1, d2)
+#define CHECK_FUNC(f) { TYPEOF(f) *a = 0; TYPEOF(MSVCRT(f)) *b = 0; a = b;  }
+
+/************* Checking types ***************/
+void test_types()
+{
+    CHECK_TYPE(wchar_t);
+    CHECK_TYPE(wint_t);
+    CHECK_TYPE(wctype_t);
+    CHECK_TYPE(_ino_t);
+    CHECK_TYPE(_fsize_t);
+    CHECK_TYPE(size_t);
+    CHECK_TYPE(_dev_t);
+    CHECK_TYPE(_off_t);
+    CHECK_TYPE(clock_t);
+    CHECK_TYPE(time_t);
+    CHECK_TYPE(fpos_t);
+    CHECK_SIZE(FILE);
+    CHECK_TYPE(terminate_handler);
+    CHECK_TYPE(terminate_function);
+    CHECK_TYPE(unexpected_handler);
+    CHECK_TYPE(unexpected_function);
+    CHECK_TYPE(_se_translator_function);
+    CHECK_TYPE(_beginthread_start_routine_t);
+    CHECK_TYPE(_onexit_t);
+}
+
+/************* Checking structs ***************/
+void test_structs()
+{
+    CHECK_STRUCT(tm);
+    CHECK_FIELD(tm, tm_sec);
+    CHECK_FIELD(tm, tm_min);
+    CHECK_FIELD(tm, tm_hour);
+    CHECK_FIELD(tm, tm_mday);
+    CHECK_FIELD(tm, tm_mon);
+    CHECK_FIELD(tm, tm_year);
+    CHECK_FIELD(tm, tm_wday);
+    CHECK_FIELD(tm, tm_yday);
+    CHECK_FIELD(tm, tm_isdst);
+    CHECK_STRUCT(_timeb);
+    CHECK_FIELD(_timeb, time);
+    CHECK_FIELD(_timeb, millitm);
+    CHECK_FIELD(_timeb, timezone);
+    CHECK_FIELD(_timeb, dstflag);
+    CHECK_STRUCT(_iobuf);
+    CHECK_FIELD(_iobuf, _ptr);
+    CHECK_FIELD(_iobuf, _cnt);
+    CHECK_FIELD(_iobuf, _base);
+    CHECK_FIELD(_iobuf, _flag);
+    CHECK_FIELD(_iobuf, _file);
+    CHECK_FIELD(_iobuf, _charbuf);
+    CHECK_FIELD(_iobuf, _bufsiz);
+    CHECK_FIELD(_iobuf, _tmpfname);
+    CHECK_STRUCT(lconv);
+    CHECK_FIELD(lconv, decimal_point);
+    CHECK_FIELD(lconv, thousands_sep);
+    CHECK_FIELD(lconv, grouping);
+    CHECK_FIELD(lconv, int_curr_symbol);
+    CHECK_FIELD(lconv, currency_symbol);
+    CHECK_FIELD(lconv, mon_decimal_point);
+    CHECK_FIELD(lconv, mon_thousands_sep);
+    CHECK_FIELD(lconv, mon_grouping);
+    CHECK_FIELD(lconv, positive_sign);
+    CHECK_FIELD(lconv, negative_sign);
+    CHECK_FIELD(lconv, int_frac_digits);
+    CHECK_FIELD(lconv, frac_digits);
+    CHECK_FIELD(lconv, p_cs_precedes);
+    CHECK_FIELD(lconv, p_sep_by_space);
+    CHECK_FIELD(lconv, n_cs_precedes);
+    CHECK_FIELD(lconv, n_sep_by_space);
+    CHECK_FIELD(lconv, p_sign_posn);
+    CHECK_FIELD(lconv, n_sign_posn);
+    CHECK_STRUCT(_exception);
+    CHECK_FIELD(_exception, type);
+    CHECK_FIELD(_exception, name);
+    CHECK_FIELD(_exception, arg1);
+    CHECK_FIELD(_exception, arg2);
+    CHECK_FIELD(_exception, retval);
+    CHECK_STRUCT(_complex);
+    CHECK_FIELD(_complex, x);
+    CHECK_FIELD(_complex, y);
+    CHECK_STRUCT(_heapinfo);
+    CHECK_FIELD(_heapinfo, _pentry);
+    CHECK_FIELD(_heapinfo, _size);
+    CHECK_FIELD(_heapinfo, _useflag);
+    CHECK_STRUCT(__JUMP_BUFFER);
+    CHECK_FIELD(__JUMP_BUFFER, Ebp);
+    CHECK_FIELD(__JUMP_BUFFER, Ebx);
+    CHECK_FIELD(__JUMP_BUFFER, Edi);
+    CHECK_FIELD(__JUMP_BUFFER, Esi);
+    CHECK_FIELD(__JUMP_BUFFER, Esp);
+    CHECK_FIELD(__JUMP_BUFFER, Eip);
+    CHECK_FIELD(__JUMP_BUFFER, Registration);
+    CHECK_FIELD(__JUMP_BUFFER, TryLevel);
+    CHECK_FIELD(__JUMP_BUFFER, Cookie);
+    CHECK_FIELD(__JUMP_BUFFER, UnwindFunc);
+    CHECK_FIELD(__JUMP_BUFFER, UnwindData[6]);
+    CHECK_STRUCT(_diskfree_t);
+    CHECK_FIELD(_diskfree_t, total_clusters);
+    CHECK_FIELD(_diskfree_t, avail_clusters);
+    CHECK_FIELD(_diskfree_t, sectors_per_cluster);
+    CHECK_FIELD(_diskfree_t, bytes_per_sector);
+    CHECK_STRUCT(_finddata_t);
+    CHECK_FIELD(_finddata_t, attrib);
+    CHECK_FIELD(_finddata_t, time_create);
+    CHECK_FIELD(_finddata_t, time_access);
+    CHECK_FIELD(_finddata_t, time_write);
+    CHECK_FIELD(_finddata_t, size);
+    CHECK_FIELD(_finddata_t, name[260]);
+    CHECK_STRUCT(_finddatai64_t);
+    CHECK_FIELD(_finddatai64_t, attrib);
+    CHECK_FIELD(_finddatai64_t, time_create);
+    CHECK_FIELD(_finddatai64_t, time_access);
+    CHECK_FIELD(_finddatai64_t, time_write);
+    CHECK_FIELD(_finddatai64_t, size);
+    CHECK_FIELD(_finddatai64_t, name[260]);
+    CHECK_STRUCT(_wfinddata_t);
+    CHECK_FIELD(_wfinddata_t, attrib);
+    CHECK_FIELD(_wfinddata_t, time_create);
+    CHECK_FIELD(_wfinddata_t, time_access);
+    CHECK_FIELD(_wfinddata_t, time_write);
+    CHECK_FIELD(_wfinddata_t, size);
+    CHECK_FIELD(_wfinddata_t, name[260]);
+    CHECK_STRUCT(_wfinddatai64_t);
+    CHECK_FIELD(_wfinddatai64_t, attrib);
+    CHECK_FIELD(_wfinddatai64_t, time_create);
+    CHECK_FIELD(_wfinddatai64_t, time_access);
+    CHECK_FIELD(_wfinddatai64_t, time_write);
+    CHECK_FIELD(_wfinddatai64_t, size);
+    CHECK_FIELD(_wfinddatai64_t, name[260]);
+    CHECK_STRUCT(_utimbuf);
+    CHECK_FIELD(_utimbuf, actime);
+    CHECK_FIELD(_utimbuf, modtime);
+    CHECK_STRUCT(_stat);
+    CHECK_FIELD(_stat, st_dev);
+    CHECK_FIELD(_stat, st_ino);
+    CHECK_FIELD(_stat, st_mode);
+    CHECK_FIELD(_stat, st_nlink);
+    CHECK_FIELD(_stat, st_uid);
+    CHECK_FIELD(_stat, st_gid);
+    CHECK_FIELD(_stat, st_rdev);
+    CHECK_FIELD(_stat, st_size);
+    CHECK_FIELD(_stat, st_atime);
+    CHECK_FIELD(_stat, st_mtime);
+    CHECK_FIELD(_stat, st_ctime);
+    CHECK_FIELD(_stat, st_dev);
+    CHECK_FIELD(_stat, st_ino);
+    CHECK_FIELD(_stat, st_mode);
+    CHECK_FIELD(_stat, st_nlink);
+    CHECK_FIELD(_stat, st_uid);
+    CHECK_FIELD(_stat, st_gid);
+    CHECK_FIELD(_stat, st_rdev);
+    CHECK_FIELD(_stat, st_size);
+    CHECK_FIELD(_stat, st_atime);
+    CHECK_FIELD(_stat, st_mtime);
+    CHECK_FIELD(_stat, st_ctime);
+    CHECK_FIELD(_stat, st_dev);
+    CHECK_FIELD(_stat, st_ino);
+    CHECK_FIELD(_stat, st_mode);
+    CHECK_FIELD(_stat, st_nlink);
+    CHECK_FIELD(_stat, st_uid);
+    CHECK_FIELD(_stat, st_gid);
+    CHECK_FIELD(_stat, st_rdev);
+    CHECK_FIELD(_stat, st_size);
+    CHECK_FIELD(_stat, st_atime);
+    CHECK_FIELD(_stat, st_mtime);
+    CHECK_FIELD(_stat, st_ctime);
+    CHECK_STRUCT(stat);
+    CHECK_FIELD(stat, st_dev);
+    CHECK_FIELD(stat, st_ino);
+    CHECK_FIELD(stat, st_mode);
+    CHECK_FIELD(stat, st_nlink);
+    CHECK_FIELD(stat, st_uid);
+    CHECK_FIELD(stat, st_gid);
+    CHECK_FIELD(stat, st_rdev);
+    CHECK_FIELD(stat, st_size);
+    CHECK_FIELD(stat, st_atime);
+    CHECK_FIELD(stat, st_mtime);
+    CHECK_FIELD(stat, st_ctime);
+    CHECK_FIELD(stat, st_dev);
+    CHECK_FIELD(stat, st_ino);
+    CHECK_FIELD(stat, st_mode);
+    CHECK_FIELD(stat, st_nlink);
+    CHECK_FIELD(stat, st_uid);
+    CHECK_FIELD(stat, st_gid);
+    CHECK_FIELD(stat, st_rdev);
+    CHECK_FIELD(stat, st_size);
+    CHECK_FIELD(stat, st_atime);
+    CHECK_FIELD(stat, st_mtime);
+    CHECK_FIELD(stat, st_ctime);
+    CHECK_FIELD(stat, st_dev);
+    CHECK_FIELD(stat, st_ino);
+    CHECK_FIELD(stat, st_mode);
+    CHECK_FIELD(stat, st_nlink);
+    CHECK_FIELD(stat, st_uid);
+    CHECK_FIELD(stat, st_gid);
+    CHECK_FIELD(stat, st_rdev);
+    CHECK_FIELD(stat, st_size);
+    CHECK_FIELD(stat, st_atime);
+    CHECK_FIELD(stat, st_mtime);
+    CHECK_FIELD(stat, st_ctime);
+    CHECK_STRUCT(_stati64);
+    CHECK_FIELD(_stati64, st_dev);
+    CHECK_FIELD(_stati64, st_ino);
+    CHECK_FIELD(_stati64, st_mode);
+    CHECK_FIELD(_stati64, st_nlink);
+    CHECK_FIELD(_stati64, st_uid);
+    CHECK_FIELD(_stati64, st_gid);
+    CHECK_FIELD(_stati64, st_rdev);
+    CHECK_FIELD(_stati64, st_size);
+    CHECK_FIELD(_stati64, st_atime);
+    CHECK_FIELD(_stati64, st_mtime);
+    CHECK_FIELD(_stati64, st_ctime);
+}
+
+/************* Checking defines ***************/
+void test_defines()
+{
+    CHECK_DEF("WEOF", WEOF, MSVCRT_WEOF);
+    CHECK_DEF("EOF", EOF, MSVCRT_EOF);
+    CHECK_DEF("TMP_MAX", TMP_MAX, MSVCRT_TMP_MAX);
+    CHECK_DEF("BUFSIZ", BUFSIZ, MSVCRT_BUFSIZ);
+    CHECK_DEF("STDIN_FILENO", STDIN_FILENO, MSVCRT_STDIN_FILENO);
+    CHECK_DEF("STDOUT_FILENO", STDOUT_FILENO, MSVCRT_STDOUT_FILENO);
+    CHECK_DEF("STDERR_FILENO", STDERR_FILENO, MSVCRT_STDERR_FILENO);
+    CHECK_DEF("_IOFBF", _IOFBF, MSVCRT__IOFBF);
+    CHECK_DEF("_IONBF", _IONBF, MSVCRT__IONBF);
+    CHECK_DEF("_IOLBF", _IOLBF, MSVCRT__IOLBF);
+    CHECK_DEF("FILENAME_MAX", FILENAME_MAX, MSVCRT_FILENAME_MAX);
+    CHECK_DEF("_P_WAIT", _P_WAIT, MSVCRT__P_WAIT);
+    CHECK_DEF("_P_NOWAIT", _P_NOWAIT, MSVCRT__P_NOWAIT);
+    CHECK_DEF("_P_OVERLAY", _P_OVERLAY, MSVCRT__P_OVERLAY);
+    CHECK_DEF("_P_NOWAITO", _P_NOWAITO, MSVCRT__P_NOWAITO);
+    CHECK_DEF("_P_DETACH", _P_DETACH, MSVCRT__P_DETACH);
+    CHECK_DEF("EPERM", EPERM, MSVCRT_EPERM);
+    CHECK_DEF("ENOENT", ENOENT, MSVCRT_ENOENT);
+    CHECK_DEF("ESRCH", ESRCH, MSVCRT_ESRCH);
+    CHECK_DEF("EINTR", EINTR, MSVCRT_EINTR);
+    CHECK_DEF("EIO", EIO, MSVCRT_EIO);
+    CHECK_DEF("ENXIO", ENXIO, MSVCRT_ENXIO);
+    CHECK_DEF("E2BIG", E2BIG, MSVCRT_E2BIG);
+    CHECK_DEF("ENOEXEC", ENOEXEC, MSVCRT_ENOEXEC);
+    CHECK_DEF("EBADF", EBADF, MSVCRT_EBADF);
+    CHECK_DEF("ECHILD", ECHILD, MSVCRT_ECHILD);
+    CHECK_DEF("EAGAIN", EAGAIN, MSVCRT_EAGAIN);
+    CHECK_DEF("ENOMEM", ENOMEM, MSVCRT_ENOMEM);
+    CHECK_DEF("EACCES", EACCES, MSVCRT_EACCES);
+    CHECK_DEF("EFAULT", EFAULT, MSVCRT_EFAULT);
+    CHECK_DEF("EBUSY", EBUSY, MSVCRT_EBUSY);
+    CHECK_DEF("EEXIST", EEXIST, MSVCRT_EEXIST);
+    CHECK_DEF("EXDEV", EXDEV, MSVCRT_EXDEV);
+    CHECK_DEF("ENODEV", ENODEV, MSVCRT_ENODEV);
+    CHECK_DEF("ENOTDIR", ENOTDIR, MSVCRT_ENOTDIR);
+    CHECK_DEF("EISDIR", EISDIR, MSVCRT_EISDIR);
+    CHECK_DEF("EINVAL", EINVAL, MSVCRT_EINVAL);
+    CHECK_DEF("ENFILE", ENFILE, MSVCRT_ENFILE);
+    CHECK_DEF("EMFILE", EMFILE, MSVCRT_EMFILE);
+    CHECK_DEF("ENOTTY", ENOTTY, MSVCRT_ENOTTY);
+    CHECK_DEF("EFBIG", EFBIG, MSVCRT_EFBIG);
+    CHECK_DEF("ENOSPC", ENOSPC, MSVCRT_ENOSPC);
+    CHECK_DEF("ESPIPE", ESPIPE, MSVCRT_ESPIPE);
+    CHECK_DEF("EROFS", EROFS, MSVCRT_EROFS);
+    CHECK_DEF("EMLINK", EMLINK, MSVCRT_EMLINK);
+    CHECK_DEF("EPIPE", EPIPE, MSVCRT_EPIPE);
+    CHECK_DEF("EDOM", EDOM, MSVCRT_EDOM);
+    CHECK_DEF("ERANGE", ERANGE, MSVCRT_ERANGE);
+    CHECK_DEF("EDEADLK", EDEADLK, MSVCRT_EDEADLK);
+    CHECK_DEF("EDEADLOCK", EDEADLOCK, MSVCRT_EDEADLOCK);
+    CHECK_DEF("ENAMETOOLONG", ENAMETOOLONG, MSVCRT_ENAMETOOLONG);
+    CHECK_DEF("ENOLCK", ENOLCK, MSVCRT_ENOLCK);
+    CHECK_DEF("ENOSYS", ENOSYS, MSVCRT_ENOSYS);
+    CHECK_DEF("ENOTEMPTY", ENOTEMPTY, MSVCRT_ENOTEMPTY);
+    CHECK_DEF("LC_ALL", LC_ALL, MSVCRT_LC_ALL);
+    CHECK_DEF("LC_COLLATE", LC_COLLATE, MSVCRT_LC_COLLATE);
+    CHECK_DEF("LC_CTYPE", LC_CTYPE, MSVCRT_LC_CTYPE);
+    CHECK_DEF("LC_MONETARY", LC_MONETARY, MSVCRT_LC_MONETARY);
+    CHECK_DEF("LC_NUMERIC", LC_NUMERIC, MSVCRT_LC_NUMERIC);
+    CHECK_DEF("LC_TIME", LC_TIME, MSVCRT_LC_TIME);
+    CHECK_DEF("LC_MIN", LC_MIN, MSVCRT_LC_MIN);
+    CHECK_DEF("LC_MAX", LC_MAX, MSVCRT_LC_MAX);
+    CHECK_DEF("_HEAPEMPTY", _HEAPEMPTY, MSVCRT__HEAPEMPTY);
+    CHECK_DEF("_HEAPOK", _HEAPOK, MSVCRT__HEAPOK);
+    CHECK_DEF("_HEAPBADBEGIN", _HEAPBADBEGIN, MSVCRT__HEAPBADBEGIN);
+    CHECK_DEF("_HEAPBADNODE", _HEAPBADNODE, MSVCRT__HEAPBADNODE);
+    CHECK_DEF("_HEAPEND", _HEAPEND, MSVCRT__HEAPEND);
+    CHECK_DEF("_HEAPBADPTR", _HEAPBADPTR, MSVCRT__HEAPBADPTR);
+    CHECK_DEF("_FREEENTRY", _FREEENTRY, MSVCRT__FREEENTRY);
+    CHECK_DEF("_USEDENTRY", _USEDENTRY, MSVCRT__USEDENTRY);
+    CHECK_DEF("_OUT_TO_DEFAULT", _OUT_TO_DEFAULT, MSVCRT__OUT_TO_DEFAULT);
+    CHECK_DEF("_REPORT_ERRMODE", _REPORT_ERRMODE, MSVCRT__REPORT_ERRMODE);
+    CHECK_DEF("_UPPER", _UPPER, MSVCRT__UPPER);
+    CHECK_DEF("_LOWER", _LOWER, MSVCRT__LOWER);
+    CHECK_DEF("_DIGIT", _DIGIT, MSVCRT__DIGIT);
+    CHECK_DEF("_SPACE", _SPACE, MSVCRT__SPACE);
+    CHECK_DEF("_PUNCT", _PUNCT, MSVCRT__PUNCT);
+    CHECK_DEF("_CONTROL", _CONTROL, MSVCRT__CONTROL);
+    CHECK_DEF("_BLANK", _BLANK, MSVCRT__BLANK);
+    CHECK_DEF("_HEX", _HEX, MSVCRT__HEX);
+    CHECK_DEF("_LEADBYTE", _LEADBYTE, MSVCRT__LEADBYTE);
+    CHECK_DEF("_ALPHA", _ALPHA, MSVCRT__ALPHA);
+    CHECK_DEF("_IOREAD", _IOREAD, MSVCRT__IOREAD);
+    CHECK_DEF("_IOWRT", _IOWRT, MSVCRT__IOWRT);
+    CHECK_DEF("_IOMYBUF", _IOMYBUF, MSVCRT__IOMYBUF);
+    CHECK_DEF("_IOEOF", _IOEOF, MSVCRT__IOEOF);
+    CHECK_DEF("_IOERR", _IOERR, MSVCRT__IOERR);
+    CHECK_DEF("_IOSTRG", _IOSTRG, MSVCRT__IOSTRG);
+    CHECK_DEF("_IORW", _IORW, MSVCRT__IORW);
+    CHECK_DEF("_S_IEXEC", _S_IEXEC, MSVCRT__S_IEXEC);
+    CHECK_DEF("_S_IWRITE", _S_IWRITE, MSVCRT__S_IWRITE);
+    CHECK_DEF("_S_IREAD", _S_IREAD, MSVCRT__S_IREAD);
+    CHECK_DEF("_S_IFIFO", _S_IFIFO, MSVCRT__S_IFIFO);
+    CHECK_DEF("_S_IFCHR", _S_IFCHR, MSVCRT__S_IFCHR);
+    CHECK_DEF("_S_IFDIR", _S_IFDIR, MSVCRT__S_IFDIR);
+    CHECK_DEF("_S_IFREG", _S_IFREG, MSVCRT__S_IFREG);
+    CHECK_DEF("_S_IFMT", _S_IFMT, MSVCRT__S_IFMT);
+}
+
+/************* Checking functions ***************/
+void test_functions()
+{
+    CHECK_FUNC(free);
+    CHECK_FUNC(malloc);
+    CHECK_FUNC(calloc);
+    CHECK_FUNC(realloc);
+    CHECK_FUNC(iswalpha);
+    CHECK_FUNC(iswspace);
+    CHECK_FUNC(iswdigit);
+    CHECK_FUNC(isleadbyte);
+    CHECK_FUNC(_exit);
+    CHECK_FUNC(abort);
+    CHECK_FUNC(__doserrno);
+    CHECK_FUNC(_errno);
+    CHECK_FUNC(getenv);
+    CHECK_FUNC(setlocale);
+    CHECK_FUNC(terminate);
+    CHECK_FUNC(time);
+}
+
+START_TEST(headers)
+{
+    test_types();
+    test_structs();
+    test_defines();
+    test_functions();
+}
--- /dev/null	2004-02-23 16:02:56.000000000 -0500
+++ dlls/msvcrt/tests/test-gen	2004-06-18 01:44:37.793557152 -0400
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+HEADER=../msvcrt.h
+SIMPLE_TYPES=`grep 'typedef.*MSVCRT_' $HEADER | grep -v ')' | sed 's/.*MSVCRT_\([^; ]*\).*;/\1/'`
+FUNC_TYPES=`grep 'typedef.*( *\* *MSVCRT_' $HEADER | sed 's/[^(]*([^*]*\*MSVCRT_\([^ )]*\).*/\1/'`
+DEFS=`grep 'define  *MSVCRT_' $HEADER | sed 's/.*define  *MSVCRT_\([^ ]*\) .*/\1/'`
+STRUCTS=`grep '^struct  *MSVCRT_' $HEADER | sed 's/.*MSVCRT_\([^ {]*\).*/\1/'`
+FUNCS=`grep '[^(]*MSVCRT_[a-zA-Z0-9_]* *(.*;' $HEADER | grep -v typedef | grep -v MSVCRT_FILE | grep -v struct | sed 's/[^(]*MSVCRT_\([a-zA-Z0-9_]*\) *(.*/\1/'`
+
+echo "/* Automatically generated test. Do not edit. */"
+echo "#define USE_MSVCRT_PREFIX"
+(cd ../../../include/msvcrt/; find -name "*.h") | sed 's/..\(.*\)/#include "\1"/'
+
+cat <<EOF
+#include "msvcrt.h"
+#include "wine/test.h"
+
+#ifdef __GNUC__
+#define TYPEOF(type) typeof(type)
+#else
+#define TYPEOF(type) int
+#endif
+#define MSVCRT(x)    MSVCRT_##x
+#define OFFSET(T,F) ((unsigned int)((char *)&((struct T *)0L)->F - (char *)0L))
+#define CHECK_SIZE(e) ok(sizeof(e) == sizeof(MSVCRT(e)), "Element has different sizes\n")
+#define CHECK_TYPE(t) { TYPEOF(t) a = 0; TYPEOF(MSVCRT(t)) b = 0; a = b; CHECK_SIZE(t); }
+#define CHECK_STRUCT(s) ok(sizeof(struct s) == sizeof(struct MSVCRT(s)), "Struct has different sizes\n")
+#define CHECK_FIELD(s,e) ok(OFFSET(s,e) == OFFSET(MSVCRT(s),e), "Bad offset\n")
+#define CHECK_DEF(n,d1,d2) ok(d1 == d2, "Defines (MSVCRT_)%s are different: '%d' vs. '%d'\n", n, d1, d2)
+#define CHECK_FUNC(f) { TYPEOF(f) *a = 0; TYPEOF(MSVCRT(f)) *b = 0; a = b;  }
+
+EOF
+
+echo "/************* Checking types ***************/"
+echo "void test_types()"
+echo "{"
+for type in $SIMPLE_TYPES $FUNC_TYPES; do
+    if [ $type = FILE ]; then
+        echo "    CHECK_SIZE($type);"
+    else
+        echo "    CHECK_TYPE($type);"
+    fi
+done
+echo "}"
+echo ""
+
+echo "/************* Checking structs ***************/"
+echo "void test_structs()"
+echo "{"
+for struct in $STRUCTS; do
+    fields=`sed -n "/^struct.*$struct/,/}/p" $HEADER | grep -v '}' | sed '1d' | grep ';' | sed 's/.*  *\([^ ;]*\) *;.*/\1/'`
+    echo "    CHECK_STRUCT($struct);"
+    for field in $fields; do
+        echo "    CHECK_FIELD($struct, $field);"
+    done
+done
+echo "}"
+echo ""
+
+echo "/************* Checking defines ***************/"
+echo "void test_defines()"
+echo "{"
+for def in $DEFS; do
+    case $def in
+        stdin) ;;
+        stdout) ;;
+        stderr) ;;
+	*) echo "    CHECK_DEF(\"$def\", $def, MSVCRT_$def);" ;;
+    esac
+done
+echo "}"
+echo ""
+
+echo "/************* Checking functions ***************/"
+echo "void test_functions()"
+echo "{"
+for func in $FUNCS; do
+    echo "    CHECK_FUNC($func);"
+done
+echo "}"
+echo ""
+
+cat <<EOF
+START_TEST(headers)
+{
+    test_types();
+    test_structs();
+    test_defines();
+    test_functions();
+}
+EOF




More information about the wine-devel mailing list