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

View file

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

View file

@ -1,40 +1,4 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#define UNICODE
#define _UNICODE
#include <stdio.h>
#include <stdarg.h>
#include <limits.h>
#include <internal/file.h>
#include <tchar.h>
int
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;
}
#include "vsprintf.c"

View file

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

View file

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

View file

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