Don't let msvcrt import itself and fix the resulting problems

svn path=/branches/xmlbuildsystem/; revision=15318
This commit is contained in:
Gé van Geldorp 2005-05-15 18:10:51 +00:00
parent fa1312ce09
commit d02a50d521
6 changed files with 26 additions and 46 deletions

View file

@ -24,6 +24,7 @@
</directory> </directory>
<directory name="ctype"> <directory name="ctype">
<file>ctype.c</file> <file>ctype.c</file>
<file>isalnum.c</file>
<file>isascii.c</file> <file>isascii.c</file>
<file>iscntrl.c</file> <file>iscntrl.c</file>
<file>isgraph.c</file> <file>isgraph.c</file>
@ -51,7 +52,9 @@
<file>abnorter.c</file> <file>abnorter.c</file>
<file>exhand2.c</file> <file>exhand2.c</file>
<file>matherr.c</file> <file>matherr.c</file>
<file>seh.s</file>
<file>unwind.c</file> <file>unwind.c</file>
<file>xcptfil.c</file>
</directory> </directory>
<directory name="float"> <directory name="float">
<file>chgsign.c</file> <file>chgsign.c</file>
@ -211,6 +214,7 @@
<file>thread.c</file> <file>thread.c</file>
<file>threadid.c</file> <file>threadid.c</file>
<file>threadx.c</file> <file>threadx.c</file>
<file>wprocess.c</file>
</directory> </directory>
<directory name="search"> <directory name="search">
<file>lfind.c</file> <file>lfind.c</file>
@ -246,6 +250,7 @@
<file>fputc.c</file> <file>fputc.c</file>
<file>fputchar.c</file> <file>fputchar.c</file>
<file>fputs.c</file> <file>fputs.c</file>
<file>fputws.c</file>
<file>fread.c</file> <file>fread.c</file>
<file>freopen.c</file> <file>freopen.c</file>
<file>fseek.c</file> <file>fseek.c</file>
@ -253,6 +258,7 @@
<file>fsopen.c</file> <file>fsopen.c</file>
<file>ftell.c</file> <file>ftell.c</file>
<file>fwalk.c</file> <file>fwalk.c</file>
<file>fwprintf.c</file>
<file>fwrite.c</file> <file>fwrite.c</file>
<file>getc.c</file> <file>getc.c</file>
<file>getchar.c</file> <file>getchar.c</file>
@ -265,6 +271,7 @@
<file>putchar.c</file> <file>putchar.c</file>
<file>puts.c</file> <file>puts.c</file>
<file>putw.c</file> <file>putw.c</file>
<file>putwchar.c</file>
<file>remove.c</file> <file>remove.c</file>
<file>rename.c</file> <file>rename.c</file>
<file>rewind.c</file> <file>rewind.c</file>
@ -278,12 +285,20 @@
<file>tmpfile.c</file> <file>tmpfile.c</file>
<file>tmpnam.c</file> <file>tmpnam.c</file>
<file>ungetc.c</file> <file>ungetc.c</file>
<file>ungetwc.c</file>
<file>vfprintf.c</file> <file>vfprintf.c</file>
<file>vfwprint.c</file> <file>vfwprint.c</file>
<file>vprintf.c</file> <file>vprintf.c</file>
<file>vsprintf.c</file> <file>vsprintf.c</file>
<file>vswprintf.c</file> <file>vswprintf.c</file>
<file>vwprintf.c</file>
<file>wfdopen.c</file> <file>wfdopen.c</file>
<file>wfopen.c</file>
<file>wfreopen.c</file>
<file>wfsopen.c</file>
<file>wpopen.c</file>
<file>wprintf.c</file>
<file>wremove.c</file>
<file>wrename.c</file> <file>wrename.c</file>
<file>wtempnam.c</file> <file>wtempnam.c</file>
<file>wtmpnam.c</file> <file>wtmpnam.c</file>

View file

@ -6,7 +6,7 @@
#include <tchar.h> #include <tchar.h>
int int
crt_vsprintf(_TCHAR *str, const _TCHAR *fmt, va_list ap) _vstprintf(_TCHAR *str, const _TCHAR *fmt, va_list ap)
{ {
FILE f = {0}; FILE f = {0};
int len; int len;
@ -22,7 +22,7 @@ crt_vsprintf(_TCHAR *str, const _TCHAR *fmt, va_list ap)
int int
crt__vsnprintf(_TCHAR *str, size_t maxlen, const _TCHAR *fmt, va_list ap) _vsntprintf(_TCHAR *str, size_t maxlen, const _TCHAR *fmt, va_list ap)
{ {
FILE f = {0}; FILE f = {0};
int len; int len;

View file

@ -1,40 +1,4 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#define UNICODE #define UNICODE
#define _UNICODE #define _UNICODE
#include <stdio.h>
#include <stdarg.h>
#include <limits.h>
#include <internal/file.h>
#include <tchar.h>
int #include "vsprintf.c"
crt__vswprintf(_TCHAR *str, const _TCHAR *fmt, va_list ap)
{
FILE f = {0};
int len;
f._flag = _IOWRT|_IOSTRG|_IOBINARY;
f._ptr = (char*)str;
f._cnt = INT_MAX;
f._file = -1;
len = _vftprintf(&f,fmt, ap);
*(_TCHAR*)f._ptr = 0;
return len;
}
int
crt__vsnwprintf(_TCHAR *str, size_t maxlen, const _TCHAR *fmt, va_list ap)
{
FILE f = {0};
int len;
f._flag = _IOWRT|_IOSTRG|_IOBINARY;
f._ptr = (char*)str;
f._cnt = maxlen;
f._file = -1;
len = _vftprintf(&f,fmt, ap);
// what if the buffer is full ??
*(_TCHAR *)f._ptr = 0;
return len;
}

View file

@ -359,8 +359,8 @@ _ungetch
_unlink _unlink
_unloaddll _unloaddll
_utime _utime
_vsnprintf=crt__vsnprintf _vsnprintf
_vsnwprintf=crt__vsnwprintf _vsnwprintf
_wcsdup _wcsdup
_wcsicmp _wcsicmp
_wcsicoll _wcsicoll
@ -541,7 +541,7 @@ ungetwc
vfprintf vfprintf
vfwprintf vfwprintf
vprintf vprintf
vsprintf=crt_vsprintf vsprintf
vswprintf vswprintf
vwprintf vwprintf
wcscat wcscat

View file

@ -555,8 +555,8 @@ _utime
_utime64=stub _utime64=stub
_vscprintf=stub _vscprintf=stub
_vscwprintf=stub _vscwprintf=stub
_vsnprintf=crt__vsnprintf _vsnprintf
_vsnwprintf=crt__vsnwprintf _vsnwprintf
_waccess _waccess
_wasctime _wasctime
_wchdir _wchdir
@ -815,7 +815,7 @@ ungetwc
vfprintf vfprintf
vfwprintf vfwprintf
vprintf vprintf
vsprintf=crt_vsprintf vsprintf
vswprintf vswprintf
vwprintf vwprintf
wcscat wcscat

View file

@ -1,6 +1,7 @@
<module name="msvcrt" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT}" mangledsymbols="true" installbase="system32" installname="msvcrt.dll"> <module name="msvcrt" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT}" mangledsymbols="true" installbase="system32" installname="msvcrt.dll">
<linkerflag>-nostartfiles</linkerflag> <linkerflag>-nostartfiles</linkerflag>
<linkerflag>--enable-stdcall-fixup</linkerflag> <linkerflag>--enable-stdcall-fixup</linkerflag>
<linkerflag>-nostdlib</linkerflag>
<linkerflag>-lgcc</linkerflag> <linkerflag>-lgcc</linkerflag>
<importlibrary definition="msvcrt.def" /> <importlibrary definition="msvcrt.def" />
<include base="msvcrt">.</include> <include base="msvcrt">.</include>
@ -14,10 +15,10 @@
<define name="_MSVCRT_LIB_" /> <define name="_MSVCRT_LIB_" />
<define name="_MT" /> <define name="_MT" />
<library>crt</library> <library>crt</library>
<library>wine</library>
<library>string</library> <library>string</library>
<library>kernel32</library> <library>kernel32</library>
<library>ntdll</library> <library>ntdll</library>
<library>wine</library>
<pch>precomp.h</pch> <pch>precomp.h</pch>
<file>dllmain.c</file> <file>dllmain.c</file>
<file>msvcrt.rc</file> <file>msvcrt.rc</file>