Removed all forwarded exports to MSVCRT because a process must not load MSVCRT and CRTDLL at the same time.

svn path=/trunk/; revision=8396
This commit is contained in:
Eric Kohl 2004-02-26 12:23:29 +00:00
parent cf035ffc03
commit b35af5f50f
7 changed files with 88 additions and 112 deletions

View file

@ -19,9 +19,9 @@
; DISCLAMED. This includes but is not limited to warrenties of ; DISCLAMED. This includes but is not limited to warrenties of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
; ;
; $Revision: 1.18 $ ; $Revision: 1.19 $
; $Author: weiden $ ; $Author: ekohl $
; $Date: 2003/08/26 12:28:53 $ ; $Date: 2004/02/26 12:23:29 $
; ;
; These three functions appear to be name mangled in some way, so GCC is ; These three functions appear to be name mangled in some way, so GCC is
; probably not going to be able to use them in any case. ; probably not going to be able to use them in any case.
@ -69,7 +69,7 @@ __argv_dll
__dllonexit __dllonexit
__doserrno __doserrno
__fpecode __fpecode
__isascii=NTDLL.__isascii __isascii
__iscsym=NTDLL.__iscsym __iscsym=NTDLL.__iscsym
__iscsymf=NTDLL.__iscsymf __iscsymf=NTDLL.__iscsymf
__mb_cur_max_dll __mb_cur_max_dll
@ -179,7 +179,7 @@ _hypot
_initterm _initterm
_iob _iob
_isatty _isatty
_isctype=MSVCRT._isctype _isctype
_ismbbalnum _ismbbalnum
_ismbbalpha _ismbbalpha
_ismbbgraph _ismbbgraph
@ -326,19 +326,19 @@ _statusfp
_strcmpi=NTDLL._strcmpi _strcmpi=NTDLL._strcmpi
_strdate _strdate
_strdec _strdec
_strdup=MSVCRT._strdup _strdup
_strerror=MSVCRT._strerror _strerror
_stricmp=NTDLL._stricmp _stricmp=NTDLL._stricmp
_stricoll=MSVCRT._stricoll _stricoll
_strinc _strinc
_strlwr=NTDLL._strlwr _strlwr=NTDLL._strlwr
_strncnt _strncnt
_strnextc _strnextc
_strnicmp=NTDLL._strnicmp _strnicmp=NTDLL._strnicmp
_strninc _strninc
_strnset=MSVCRT._strnset _strnset
_strrev=MSVCRT._strrev _strrev
_strset=MSVCRT._strset _strset
_strspnp _strspnp
_strtime _strtime
_strupr=NTDLL._strupr _strupr=NTDLL._strupr
@ -434,31 +434,31 @@ getchar
getenv getenv
gets gets
gmtime gmtime
is_wctype=MSVCRT.is_wctype is_wctype
isalnum=NTDLL.isalnum isalnum
isalpha=NTDLL.isalpha isalpha=NTDLL.isalpha
iscntrl=NTDLL.iscntrl iscntrl
isdigit=NTDLL.isdigit isdigit=NTDLL.isdigit
isgraph=NTDLL.isgraph isgraph
isleadbyte isleadbyte
islower=NTDLL.islower islower=NTDLL.islower
isprint=NTDLL.isprint isprint
ispunct=NTDLL.ispunct ispunct
isspace=NTDLL.isspace isspace=NTDLL.isspace
isupper=NTDLL.isupper isupper
iswalnum=MSVCRT.iswalnum iswalnum
iswalpha=NTDLL.iswalpha iswalpha=NTDLL.iswalpha
iswascii=MSVCRT.iswascii iswascii
iswcntrl=MSVCRT.iswcntrl iswcntrl
iswctype=MSVCRT.iswctype iswctype
iswdigit=MSVCRT.iswdigit iswdigit
iswgraph=MSVCRT.iswgraph iswgraph
iswlower=MSVCRT.iswlower iswlower
iswprint=MSVCRT.iswprint iswprint
iswpunct=MSVCRT.iswpunct iswpunct
iswspace=NTDLL.iswspace iswspace=NTDLL.iswspace
iswupper=MSVCRT.iswupper iswupper
iswxdigit=MSVCRT.iswxdigit iswxdigit
isxdigit=NTDLL.isxdigit isxdigit=NTDLL.isxdigit
labs labs
ldexp ldexp
@ -506,10 +506,10 @@ sscanf
strcat strcat
strchr strchr
strcmp strcmp
strcoll=MSVCRT.strcoll strcoll
strcpy strcpy
strcspn strcspn
strerror=MSVCRT.strerror strerror
strftime strftime
strlen strlen
strncat strncat
@ -523,7 +523,7 @@ strtod
strtok strtok
strtol strtol
strtoul strtoul
strxfrm=MSVCRT.strxfrm strxfrm
swprintf swprintf
swscanf swscanf
system system

View file

@ -10,39 +10,26 @@ unsigned short *_pwctype_dll = _ctype + 1;
/* /*
* @implemented * @implemented
*
* this function is now forwarded to MSVCRT._isctype to reduce code duplication
*/ */
#if 0
int _isctype(unsigned int c, int ctypeFlags) int _isctype(unsigned int c, int ctypeFlags)
{ {
return (_pctype_dll[(unsigned char)(c & 0xFF)] & ctypeFlags); return (_pctype_dll[(unsigned char)(c & 0xFF)] & ctypeFlags);
} }
#endif
/* /*
* @implemented * @implemented
*
* this function is now forwarded to MSVCRT.iswctype to reduce code duplication
*/ */
#if 0
int iswctype(wint_t wc, wctype_t wctypeFlags) int iswctype(wint_t wc, wctype_t wctypeFlags)
{ {
return (_pwctype_dll[(unsigned char)(wc & 0xFF)] & wctypeFlags); return (_pwctype_dll[(unsigned char)(wc & 0xFF)] & wctypeFlags);
} }
#endif
// obsolete
/* /*
* @implemented * @implemented
*
* this function is now forwarded to MSVCRT.is_wctype to reduce code duplication
*/ */
#if 0 int is_wctype(wint_t wc, wctype_t wctypeFlags)
int is_wctype(wint_t wc, wctype_t wctypeFlags)
{ {
return (_pwctype_dll[(unsigned char)(wc & 0xFF)] & wctypeFlags); return (_pwctype_dll[(unsigned char)(wc & 0xFF)] & wctypeFlags);
} }
#endif
/* EOF */ /* EOF */

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.62 2003/11/14 17:13:30 weiden Exp $ # $Id: makefile,v 1.63 2004/02/26 12:23:29 ekohl Exp $
PATH_TO_TOP = ../.. PATH_TO_TOP = ../..
@ -12,7 +12,7 @@ TARGET_NAME = crtdll
TARGET_BASE = 0x77630000 TARGET_BASE = 0x77630000
TARGET_LFLAGS = -nostartfiles TARGET_LFLAGS = -nostartfiles -nostdlib
TARGET_CFLAGS = -D_MSVCRT_LIB_ -Werror -Wall TARGET_CFLAGS = -D_MSVCRT_LIB_ -Werror -Wall
@ -21,6 +21,8 @@ TARGET_CFLAGS += -D_DISABLE_TIDENTS
TARGET_SDKLIBS = string.a kernel32.a ntdll.a TARGET_SDKLIBS = string.a kernel32.a ntdll.a
TARGET_GCCLIBS = gcc
TARGET_OBJECTS = $(TARGET_NAME).o TARGET_OBJECTS = $(TARGET_NAME).o
TARGET_CLEAN = \ TARGET_CLEAN = \
@ -68,21 +70,21 @@ CONIO_OBJECTS = \
CTYPE_OBJECTS = \ CTYPE_OBJECTS = \
$(PATH_TO_MSVCRT)/ctype/ctype.o \ $(PATH_TO_MSVCRT)/ctype/ctype.o \
ctype/isctype.o $(PATH_TO_MSVCRT)/ctype/isalnum.o \
$(PATH_TO_MSVCRT)/ctype/isascii.o \
$(PATH_TO_MSVCRT)/ctype/iscntrl.o \
ctype/isctype.o \
$(PATH_TO_MSVCRT)/ctype/isgraph.o \
$(PATH_TO_MSVCRT)/ctype/isprint.o \
$(PATH_TO_MSVCRT)/ctype/ispunct.o \
$(PATH_TO_MSVCRT)/ctype/isupper.o
# REMOVED CTYPE ENTRIES: # REMOVED CTYPE ENTRIES:
# $(PATH_TO_MSVCRT)/ctype/isalnum.o \
# $(PATH_TO_MSVCRT)/ctype/isalpha.o \ # $(PATH_TO_MSVCRT)/ctype/isalpha.o \
# $(PATH_TO_MSVCRT)/ctype/isascii.o \
# $(PATH_TO_MSVCRT)/ctype/iscntrl.o \
# $(PATH_TO_MSVCRT)/ctype/iscsym.o \ # $(PATH_TO_MSVCRT)/ctype/iscsym.o \
# $(PATH_TO_MSVCRT)/ctype/isdigit.o \ # $(PATH_TO_MSVCRT)/ctype/isdigit.o \
# $(PATH_TO_MSVCRT)/ctype/isgraph.o \
# $(PATH_TO_MSVCRT)/ctype/islower.o \ # $(PATH_TO_MSVCRT)/ctype/islower.o \
# $(PATH_TO_MSVCRT)/ctype/isprint.o \
# $(PATH_TO_MSVCRT)/ctype/ispunct.o \
# $(PATH_TO_MSVCRT)/ctype/isspace.o \ # $(PATH_TO_MSVCRT)/ctype/isspace.o \
# $(PATH_TO_MSVCRT)/ctype/isupper.o \
# $(PATH_TO_MSVCRT)/ctype/isxdigit.o \ # $(PATH_TO_MSVCRT)/ctype/isxdigit.o \
# $(PATH_TO_MSVCRT)/ctype/toascii.o \ # $(PATH_TO_MSVCRT)/ctype/toascii.o \
# $(PATH_TO_MSVCRT)/ctype/tolower.o \ # $(PATH_TO_MSVCRT)/ctype/tolower.o \
@ -397,26 +399,27 @@ STDLIB_OBJECTS = \
$(PATH_TO_MSVCRT)/stdlib/strtol.o \ $(PATH_TO_MSVCRT)/stdlib/strtol.o \
$(PATH_TO_MSVCRT)/stdlib/strtoul.o \ $(PATH_TO_MSVCRT)/stdlib/strtoul.o \
$(PATH_TO_MSVCRT)/stdlib/swab.o \ $(PATH_TO_MSVCRT)/stdlib/swab.o \
$(PATH_TO_MSVCRT)/stdlib/wcstomb.o \ $(PATH_TO_MSVCRT)/stdlib/wcstod.o \
stdlib/wcstomb.o
STRING_OBJECTS = \ STRING_OBJECTS = \
string/lasttok.o \ string/lasttok.o \
$(PATH_TO_MSVCRT)/string/strtok.o \ $(PATH_TO_MSVCRT)/string/strcoll.o \
string/str_old.o \ $(PATH_TO_MSVCRT)/string/strdup.o \
string/strerror.o \ string/strerror.o \
$(PATH_TO_MSVCRT)/string/strrev.o \
$(PATH_TO_MSVCRT)/string/strset.o \
$(PATH_TO_MSVCRT)/string/strtok.o \
$(PATH_TO_MSVCRT)/string/strxfrm.o
# string/str_old.o \
# $(PATH_TO_MSVCRT)/string/memicmp.o \ # $(PATH_TO_MSVCRT)/string/memicmp.o \
# $(PATH_TO_MSVCRT)/string/strcoll.o \
# $(PATH_TO_MSVCRT)/string/strdup.o \
# $(PATH_TO_MSVCRT)/string/stricmp.o \ # $(PATH_TO_MSVCRT)/string/stricmp.o \
# $(PATH_TO_MSVCRT)/string/strlwr.o \ # $(PATH_TO_MSVCRT)/string/strlwr.o \
# $(PATH_TO_MSVCRT)/string/strnicmp.o \ # $(PATH_TO_MSVCRT)/string/strnicmp.o \
# $(PATH_TO_MSVCRT)/string/strpbrk.o \ # $(PATH_TO_MSVCRT)/string/strpbrk.o \
# $(PATH_TO_MSVCRT)/string/strrev.o \
# $(PATH_TO_MSVCRT)/string/strset.o \
# $(PATH_TO_MSVCRT)/string/strstr.o \ # $(PATH_TO_MSVCRT)/string/strstr.o \
# $(PATH_TO_MSVCRT)/string/strupr.o \ # $(PATH_TO_MSVCRT)/string/strupr.o \
# $(PATH_TO_MSVCRT)/string/strxfrm.o
SYS_STAT_OBJECTS = \ SYS_STAT_OBJECTS = \
sys_stat/fstat.o \ sys_stat/fstat.o \
@ -441,28 +444,28 @@ TIME_OBJECTS = \
$(PATH_TO_MSVCRT)/time/strdate.o \ $(PATH_TO_MSVCRT)/time/strdate.o \
$(PATH_TO_MSVCRT)/time/strftime.o \ $(PATH_TO_MSVCRT)/time/strftime.o \
$(PATH_TO_MSVCRT)/time/strtime.o \ $(PATH_TO_MSVCRT)/time/strtime.o \
time/tz_vars.o \ time/tz_vars.o
WSTRING_OBJECTS = \ WSTRING_OBJECTS = \
wchar/wlasttok.o \
wchar/wcscoll.o \
$(PATH_TO_MSVCRT)/wstring/wcsdup.o \
$(PATH_TO_MSVCRT)/wstring/wcsrev.o \
$(PATH_TO_MSVCRT)/wstring/wcsset.o \
$(PATH_TO_MSVCRT)/wstring/wcstok.o \ $(PATH_TO_MSVCRT)/wstring/wcstok.o \
wchar/wlasttok.o $(PATH_TO_MSVCRT)/wstring/wcsxfrm.o
# wchar/wcscoll.o \
# wchar/wcstod.o \ # wchar/wcstod.o \
# wchar/wcstok.o \ # wchar/wcstok.o \
# wchar/wcstol.o \ # wchar/wcstol.o \
# wchar/wtoi.o \ # wchar/wtoi.o \
# $(PATH_TO_MSVCRT)/wstring/wcscspn.o \ # $(PATH_TO_MSVCRT)/wstring/wcscspn.o \
# $(PATH_TO_MSVCRT)/wstring/wcsdup.o \
# $(PATH_TO_MSVCRT)/wstring/wcsicmp.o \ # $(PATH_TO_MSVCRT)/wstring/wcsicmp.o \
# $(PATH_TO_MSVCRT)/wstring/wcslwr.o \ # $(PATH_TO_MSVCRT)/wstring/wcslwr.o \
# $(PATH_TO_MSVCRT)/wstring/wcspbrk.o \ # $(PATH_TO_MSVCRT)/wstring/wcspbrk.o \
# $(PATH_TO_MSVCRT)/wstring/wcsrev.o \
# $(PATH_TO_MSVCRT)/wstring/wcsset.o \
# $(PATH_TO_MSVCRT)/wstring/wcsspn.o \ # $(PATH_TO_MSVCRT)/wstring/wcsspn.o \
# $(PATH_TO_MSVCRT)/wstring/wcsstr.o \ # $(PATH_TO_MSVCRT)/wstring/wcsstr.o \
# $(PATH_TO_MSVCRT)/wstring/wcsupr.o \ # $(PATH_TO_MSVCRT)/wstring/wcsupr.o \
# $(PATH_TO_MSVCRT)/wstring/wcsxfrm.o \
# wchar/wcstombs.o \ # wchar/wcstombs.o \
# $(PATH_TO_MSVCRT)/wstring/wcsnicmp.o # $(PATH_TO_MSVCRT)/wstring/wcsnicmp.o

View file

@ -39,10 +39,11 @@ char *** _environ_dll = &_environ;
static int envAlloced = 0; static int envAlloced = 0;
int BlockEnvToEnviron() int BlockEnvToEnviron(void)
{ {
char * ptr; char * ptr;
int i; int i;
if (!envAlloced) if (!envAlloced)
{ {
envAlloced = 50; envAlloced = 50;
@ -96,7 +97,7 @@ int __GetMainArgs(int *argc,char ***argv,char ***env,int flag)
{ {
__argc++; __argc++;
_acmdln_dll[i]='\0'; _acmdln_dll[i]='\0';
__argv[__argc-1] = strdup(_acmdln_dll + afterlastspace); __argv[__argc-1] = _strdup(_acmdln_dll + afterlastspace);
_acmdln_dll[i]=' '; _acmdln_dll[i]=' ';
i++; i++;
while (_acmdln_dll[i]==' ') while (_acmdln_dll[i]==' ')
@ -113,7 +114,7 @@ int __GetMainArgs(int *argc,char ***argv,char ***env,int flag)
{ {
__argc++; __argc++;
_acmdln_dll[i]='\0'; _acmdln_dll[i]='\0';
__argv[__argc-1] = strdup(_acmdln_dll+afterlastspace); __argv[__argc-1] = _strdup(_acmdln_dll+afterlastspace);
} }
HeapValidate(GetProcessHeap(),0,NULL); HeapValidate(GetProcessHeap(),0,NULL);
@ -125,7 +126,7 @@ int __GetMainArgs(int *argc,char ***argv,char ***env,int flag)
*argv = __argv; *argv = __argv;
*env = _environ; *env = _environ;
_pgmptr_dll = strdup((char *)argv[0]); _pgmptr_dll = _strdup((char *)argv[0]);
return 0; return 0;
} }

View file

@ -16,7 +16,7 @@
*/ */
int _aexit_rtn_dll(int exitcode) int _aexit_rtn_dll(int exitcode)
{ {
_exit(exitcode); _exit(exitcode);
} }
/* /*
@ -24,7 +24,7 @@ int _aexit_rtn_dll(int exitcode)
*/ */
void _amsg_exit(int errnum) void _amsg_exit(int errnum)
{ {
fprintf(stderr,strerror(errnum)); fprintf(stderr,strerror(errnum));
_aexit_rtn_dll(-1); _aexit_rtn_dll(-1);
} }

View file

@ -21,7 +21,8 @@
#include <msvcrt/errno.h> #include <msvcrt/errno.h>
#include <msvcrt/wchar.h> #include <msvcrt/wchar.h>
#include <msvcrt/internal/file.h>
#include "libc/file.h"
#ifndef EILSEQ #ifndef EILSEQ
#define EILSEQ EINVAL #define EILSEQ EINVAL
@ -79,22 +80,12 @@ __wcrtomb (char *s, wchar_t wc)
char fake[1]; char fake[1];
size_t written = 0; size_t written = 0;
if (s == NULL) if (s == NULL)
{ {
s = fake; s = fake;
wc = L'\0'; wc = L'\0';
} }
/* Store the UTF8 representation of WC. */
if (wc < 0 || wc > 0x7fffffff)
{
/* This is no correct ISO 10646 character. */
__set_errno (EILSEQ);
return (size_t) -1;
}
if (wc < 0x80) if (wc < 0x80)
{ {
/* It's a one byte sequence. */ /* It's a one byte sequence. */

View file

@ -63,9 +63,7 @@ int* _sys_nerr_dll = &__sys_nerr;
/* /*
* @implemented * @implemented
* *
* this function is now forwarded to MSVCRT.strerror to reduce code duplication
*/ */
#if 0
char *strerror(int errnum) char *strerror(int errnum)
{ {
static char ebuf[40]; /* 64-bit number + slop */ static char ebuf[40]; /* 64-bit number + slop */
@ -96,14 +94,11 @@ char *strerror(int errnum)
return ebuf; return ebuf;
} }
#endif
/* /*
* @implemented * @implemented
* *
* this function is now forwarded to MSVCRT._strerror to reduce code duplication
*/ */
#if 0
char *_strerror(const char *s) char *_strerror(const char *s)
{ {
if ( s == NULL ) if ( s == NULL )
@ -111,4 +106,3 @@ char *_strerror(const char *s)
return strerror(atoi(s)); return strerror(atoi(s));
} }
#endif