Commit 6bbd3cac authored by Tijl Coosemans's avatar Tijl Coosemans Committed by Alexandre Julliard

msvcrt: Resolve symbols clashes with FreeBSD libc.

parent 8086079b
...@@ -131,7 +131,7 @@ static void msvcrt_wfttofdi64( const WIN32_FIND_DATAW *fd, struct MSVCRT__wfindd ...@@ -131,7 +131,7 @@ static void msvcrt_wfttofdi64( const WIN32_FIND_DATAW *fd, struct MSVCRT__wfindd
* NOTES * NOTES
* See SetCurrentDirectoryA. * See SetCurrentDirectoryA.
*/ */
int CDECL _chdir(const char * newdir) int CDECL MSVCRT__chdir(const char * newdir)
{ {
if (!SetCurrentDirectoryA(newdir)) if (!SetCurrentDirectoryA(newdir))
{ {
...@@ -627,7 +627,7 @@ unsigned int CDECL MSVCRT__getdiskfree(unsigned int disk, struct MSVCRT__diskfre ...@@ -627,7 +627,7 @@ unsigned int CDECL MSVCRT__getdiskfree(unsigned int disk, struct MSVCRT__diskfre
* NOTES * NOTES
* See CreateDirectoryA. * See CreateDirectoryA.
*/ */
int CDECL _mkdir(const char * newdir) int CDECL MSVCRT__mkdir(const char * newdir)
{ {
if (CreateDirectoryA(newdir,NULL)) if (CreateDirectoryA(newdir,NULL))
return 0; return 0;
...@@ -663,7 +663,7 @@ int CDECL _wmkdir(const MSVCRT_wchar_t* newdir) ...@@ -663,7 +663,7 @@ int CDECL _wmkdir(const MSVCRT_wchar_t* newdir)
* NOTES * NOTES
* See RemoveDirectoryA. * See RemoveDirectoryA.
*/ */
int CDECL _rmdir(const char * dir) int CDECL MSVCRT__rmdir(const char * dir)
{ {
if (RemoveDirectoryA(dir)) if (RemoveDirectoryA(dir))
return 0; return 0;
......
...@@ -241,11 +241,11 @@ void CDECL MSVCRT_perror(const char* str) ...@@ -241,11 +241,11 @@ void CDECL MSVCRT_perror(const char* str)
if (str && *str) if (str && *str)
{ {
_write( 2, str, strlen(str) ); MSVCRT__write( 2, str, strlen(str) );
_write( 2, ": ", 2 ); MSVCRT__write( 2, ": ", 2 );
} }
_write( 2, MSVCRT__sys_errlist[err], strlen(MSVCRT__sys_errlist[err]) ); MSVCRT__write( 2, MSVCRT__sys_errlist[err], strlen(MSVCRT__sys_errlist[err]) );
_write( 2, "\n", 1 ); MSVCRT__write( 2, "\n", 1 );
} }
/****************************************************************************** /******************************************************************************
......
...@@ -400,7 +400,7 @@ static int msvcrt_flush_buffer(MSVCRT_FILE* file) ...@@ -400,7 +400,7 @@ static int msvcrt_flush_buffer(MSVCRT_FILE* file)
{ {
if(file->_bufsiz) { if(file->_bufsiz) {
int cnt=file->_ptr-file->_base; int cnt=file->_ptr-file->_base;
if(cnt>0 && _write(file->_file, file->_base, cnt) != cnt) { if(cnt>0 && MSVCRT__write(file->_file, file->_base, cnt) != cnt) {
file->_flag |= MSVCRT__IOERR; file->_flag |= MSVCRT__IOERR;
return MSVCRT_EOF; return MSVCRT_EOF;
} }
...@@ -460,7 +460,7 @@ MSVCRT_FILE * CDECL __p__iob(void) ...@@ -460,7 +460,7 @@ MSVCRT_FILE * CDECL __p__iob(void)
/********************************************************************* /*********************************************************************
* _access (MSVCRT.@) * _access (MSVCRT.@)
*/ */
int CDECL _access(const char *filename, int mode) int CDECL MSVCRT__access(const char *filename, int mode)
{ {
DWORD attr = GetFileAttributesA(filename); DWORD attr = GetFileAttributesA(filename);
...@@ -504,7 +504,7 @@ int CDECL _waccess(const MSVCRT_wchar_t *filename, int mode) ...@@ -504,7 +504,7 @@ int CDECL _waccess(const MSVCRT_wchar_t *filename, int mode)
/********************************************************************* /*********************************************************************
* _chmod (MSVCRT.@) * _chmod (MSVCRT.@)
*/ */
int CDECL _chmod(const char *path, int flags) int CDECL MSVCRT__chmod(const char *path, int flags)
{ {
DWORD oldFlags = GetFileAttributesA(path); DWORD oldFlags = GetFileAttributesA(path);
...@@ -542,7 +542,7 @@ int CDECL _wchmod(const MSVCRT_wchar_t *path, int flags) ...@@ -542,7 +542,7 @@ int CDECL _wchmod(const MSVCRT_wchar_t *path, int flags)
/********************************************************************* /*********************************************************************
* _unlink (MSVCRT.@) * _unlink (MSVCRT.@)
*/ */
int CDECL _unlink(const char *path) int CDECL MSVCRT__unlink(const char *path)
{ {
TRACE("%s\n",debugstr_a(path)); TRACE("%s\n",debugstr_a(path));
if(DeleteFileA(path)) if(DeleteFileA(path))
...@@ -613,7 +613,7 @@ int CDECL MSVCRT_fflush(MSVCRT_FILE* file) ...@@ -613,7 +613,7 @@ int CDECL MSVCRT_fflush(MSVCRT_FILE* file)
/********************************************************************* /*********************************************************************
* _close (MSVCRT.@) * _close (MSVCRT.@)
*/ */
int CDECL _close(int fd) int CDECL MSVCRT__close(int fd)
{ {
HANDLE hand; HANDLE hand;
int ret; int ret;
...@@ -675,7 +675,7 @@ int CDECL _commit(int fd) ...@@ -675,7 +675,7 @@ int CDECL _commit(int fd)
* indicate file descriptors duplicated with _dup and _dup2 are always * indicate file descriptors duplicated with _dup and _dup2 are always
* inheritable. * inheritable.
*/ */
int CDECL _dup2(int od, int nd) int CDECL MSVCRT__dup2(int od, int nd)
{ {
int ret; int ret;
...@@ -691,7 +691,7 @@ int CDECL _dup2(int od, int nd) ...@@ -691,7 +691,7 @@ int CDECL _dup2(int od, int nd)
int wxflag = MSVCRT_fdesc[od].wxflag & ~MSVCRT__O_NOINHERIT; int wxflag = MSVCRT_fdesc[od].wxflag & ~MSVCRT__O_NOINHERIT;
if (msvcrt_is_valid_fd(nd)) if (msvcrt_is_valid_fd(nd))
_close(nd); MSVCRT__close(nd);
ret = msvcrt_alloc_fd_from(handle, wxflag, nd); ret = msvcrt_alloc_fd_from(handle, wxflag, nd);
if (ret == -1) if (ret == -1)
{ {
...@@ -722,13 +722,13 @@ int CDECL _dup2(int od, int nd) ...@@ -722,13 +722,13 @@ int CDECL _dup2(int od, int nd)
/********************************************************************* /*********************************************************************
* _dup (MSVCRT.@) * _dup (MSVCRT.@)
*/ */
int CDECL _dup(int od) int CDECL MSVCRT__dup(int od)
{ {
int fd, ret; int fd, ret;
LOCK_FILES(); LOCK_FILES();
fd = MSVCRT_fdstart; fd = MSVCRT_fdstart;
if (_dup2(od, fd) == 0) if (MSVCRT__dup2(od, fd) == 0)
ret = fd; ret = fd;
else else
ret = -1; ret = -1;
...@@ -1359,7 +1359,7 @@ static unsigned split_oflags(unsigned oflags) ...@@ -1359,7 +1359,7 @@ static unsigned split_oflags(unsigned oflags)
/********************************************************************* /*********************************************************************
* _pipe (MSVCRT.@) * _pipe (MSVCRT.@)
*/ */
int CDECL _pipe(int *pfds, unsigned int psize, int textmode) int CDECL MSVCRT__pipe(int *pfds, unsigned int psize, int textmode)
{ {
int ret = -1; int ret = -1;
SECURITY_ATTRIBUTES sa; SECURITY_ATTRIBUTES sa;
...@@ -1392,7 +1392,7 @@ int CDECL _pipe(int *pfds, unsigned int psize, int textmode) ...@@ -1392,7 +1392,7 @@ int CDECL _pipe(int *pfds, unsigned int psize, int textmode)
} }
else else
{ {
_close(pfds[0]); MSVCRT__close(pfds[0]);
CloseHandle(writeHandle); CloseHandle(writeHandle);
*MSVCRT__errno() = MSVCRT_EMFILE; *MSVCRT__errno() = MSVCRT_EMFILE;
} }
...@@ -1535,7 +1535,7 @@ int CDECL MSVCRT__wsopen( const MSVCRT_wchar_t* path, int oflags, int shflags, . ...@@ -1535,7 +1535,7 @@ int CDECL MSVCRT__wsopen( const MSVCRT_wchar_t* path, int oflags, int shflags, .
/********************************************************************* /*********************************************************************
* _open (MSVCRT.@) * _open (MSVCRT.@)
*/ */
int CDECL _open( const char *path, int flags, ... ) int CDECL MSVCRT__open( const char *path, int flags, ... )
{ {
va_list ap; va_list ap;
...@@ -1567,7 +1567,7 @@ int CDECL _wopen(const MSVCRT_wchar_t *path,int flags,...) ...@@ -1567,7 +1567,7 @@ int CDECL _wopen(const MSVCRT_wchar_t *path,int flags,...)
if (patha && WideCharToMultiByte(CP_ACP,0,path,len,patha,len,NULL,NULL)) if (patha && WideCharToMultiByte(CP_ACP,0,path,len,patha,len,NULL,NULL))
{ {
int retval = _open(patha,flags,pmode); int retval = MSVCRT__open(patha,flags,pmode);
MSVCRT_free(patha); MSVCRT_free(patha);
return retval; return retval;
} }
...@@ -1579,10 +1579,10 @@ int CDECL _wopen(const MSVCRT_wchar_t *path,int flags,...) ...@@ -1579,10 +1579,10 @@ int CDECL _wopen(const MSVCRT_wchar_t *path,int flags,...)
/********************************************************************* /*********************************************************************
* _creat (MSVCRT.@) * _creat (MSVCRT.@)
*/ */
int CDECL _creat(const char *path, int flags) int CDECL MSVCRT__creat(const char *path, int flags)
{ {
int usedFlags = (flags & MSVCRT__O_TEXT)| MSVCRT__O_CREAT| MSVCRT__O_WRONLY| MSVCRT__O_TRUNC; int usedFlags = (flags & MSVCRT__O_TEXT)| MSVCRT__O_CREAT| MSVCRT__O_WRONLY| MSVCRT__O_TRUNC;
return _open(path, usedFlags); return MSVCRT__open(path, usedFlags);
} }
/********************************************************************* /*********************************************************************
...@@ -1712,7 +1712,7 @@ static int read_i(int fd, void *buf, unsigned int count) ...@@ -1712,7 +1712,7 @@ static int read_i(int fd, void *buf, unsigned int count)
/********************************************************************* /*********************************************************************
* _read (MSVCRT.@) * _read (MSVCRT.@)
*/ */
int CDECL _read(int fd, void *buf, unsigned int count) int CDECL MSVCRT__read(int fd, void *buf, unsigned int count)
{ {
int num_read; int num_read;
num_read = read_i(fd, buf, count); num_read = read_i(fd, buf, count);
...@@ -1978,7 +1978,7 @@ MSVCRT_wchar_t * CDECL _wtempnam(const MSVCRT_wchar_t *dir, const MSVCRT_wchar_t ...@@ -1978,7 +1978,7 @@ MSVCRT_wchar_t * CDECL _wtempnam(const MSVCRT_wchar_t *dir, const MSVCRT_wchar_t
/********************************************************************* /*********************************************************************
* _umask (MSVCRT.@) * _umask (MSVCRT.@)
*/ */
int CDECL _umask(int umask) int CDECL MSVCRT__umask(int umask)
{ {
int old_umask = MSVCRT_umask; int old_umask = MSVCRT_umask;
TRACE("(%d)\n",umask); TRACE("(%d)\n",umask);
...@@ -1991,12 +1991,12 @@ int CDECL _umask(int umask) ...@@ -1991,12 +1991,12 @@ int CDECL _umask(int umask)
*/ */
int CDECL _utime(const char* path, struct MSVCRT__utimbuf *t) int CDECL _utime(const char* path, struct MSVCRT__utimbuf *t)
{ {
int fd = _open(path, MSVCRT__O_WRONLY | MSVCRT__O_BINARY); int fd = MSVCRT__open(path, MSVCRT__O_WRONLY | MSVCRT__O_BINARY);
if (fd > 0) if (fd > 0)
{ {
int retVal = _futime(fd, t); int retVal = _futime(fd, t);
_close(fd); MSVCRT__close(fd);
return retVal; return retVal;
} }
return -1; return -1;
...@@ -2012,7 +2012,7 @@ int CDECL _wutime(const MSVCRT_wchar_t* path, struct MSVCRT__utimbuf *t) ...@@ -2012,7 +2012,7 @@ int CDECL _wutime(const MSVCRT_wchar_t* path, struct MSVCRT__utimbuf *t)
if (fd > 0) if (fd > 0)
{ {
int retVal = _futime(fd, t); int retVal = _futime(fd, t);
_close(fd); MSVCRT__close(fd);
return retVal; return retVal;
} }
return -1; return -1;
...@@ -2021,7 +2021,7 @@ int CDECL _wutime(const MSVCRT_wchar_t* path, struct MSVCRT__utimbuf *t) ...@@ -2021,7 +2021,7 @@ int CDECL _wutime(const MSVCRT_wchar_t* path, struct MSVCRT__utimbuf *t)
/********************************************************************* /*********************************************************************
* _write (MSVCRT.@) * _write (MSVCRT.@)
*/ */
int CDECL _write(int fd, const void* buf, unsigned int count) int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count)
{ {
DWORD num_written; DWORD num_written;
HANDLE hand = msvcrt_fdtoh(fd); HANDLE hand = msvcrt_fdtoh(fd);
...@@ -2114,7 +2114,7 @@ int CDECL _write(int fd, const void* buf, unsigned int count) ...@@ -2114,7 +2114,7 @@ int CDECL _write(int fd, const void* buf, unsigned int count)
int CDECL MSVCRT__putw(int val, MSVCRT_FILE* file) int CDECL MSVCRT__putw(int val, MSVCRT_FILE* file)
{ {
int len; int len;
len = _write(file->_file, &val, sizeof(val)); len = MSVCRT__write(file->_file, &val, sizeof(val));
if (len == sizeof(val)) return val; if (len == sizeof(val)) return val;
file->_flag |= MSVCRT__IOERR; file->_flag |= MSVCRT__IOERR;
return MSVCRT_EOF; return MSVCRT_EOF;
...@@ -2136,7 +2136,7 @@ int CDECL MSVCRT_fclose(MSVCRT_FILE* file) ...@@ -2136,7 +2136,7 @@ int CDECL MSVCRT_fclose(MSVCRT_FILE* file)
if(file->_flag & MSVCRT__IOMYBUF) if(file->_flag & MSVCRT__IOMYBUF)
MSVCRT_free(file->_base); MSVCRT_free(file->_base);
r=_close(file->_file); r=MSVCRT__close(file->_file);
file->_flag = 0; file->_flag = 0;
...@@ -2399,7 +2399,7 @@ MSVCRT_size_t CDECL MSVCRT_fwrite(const void *ptr, MSVCRT_size_t size, MSVCRT_si ...@@ -2399,7 +2399,7 @@ MSVCRT_size_t CDECL MSVCRT_fwrite(const void *ptr, MSVCRT_size_t size, MSVCRT_si
/* Flush buffer */ /* Flush buffer */
int res=msvcrt_flush_buffer(file); int res=msvcrt_flush_buffer(file);
if(!res) { if(!res) {
int pwritten = _write(file->_file, ptr, wrcnt); int pwritten = MSVCRT__write(file->_file, ptr, wrcnt);
if (pwritten <= 0) if (pwritten <= 0)
{ {
file->_flag |= MSVCRT__IOERR; file->_flag |= MSVCRT__IOERR;
...@@ -2459,7 +2459,7 @@ MSVCRT_FILE * CDECL MSVCRT__fsopen(const char *path, const char *mode, int share ...@@ -2459,7 +2459,7 @@ MSVCRT_FILE * CDECL MSVCRT__fsopen(const char *path, const char *mode, int share
TRACE(":got (%p)\n",file); TRACE(":got (%p)\n",file);
if (fd >= 0 && !file) if (fd >= 0 && !file)
_close(fd); MSVCRT__close(fd);
UNLOCK_FILES(); UNLOCK_FILES();
return file; return file;
} }
...@@ -2550,7 +2550,7 @@ int CDECL MSVCRT__flsbuf(int c, MSVCRT_FILE* file) ...@@ -2550,7 +2550,7 @@ int CDECL MSVCRT__flsbuf(int c, MSVCRT_FILE* file)
} else { } else {
unsigned char cc=c; unsigned char cc=c;
int len; int len;
len = _write(file->_file, &cc, 1); len = MSVCRT__write(file->_file, &cc, 1);
if (len == 1) return c; if (len == 1) return c;
file->_flag |= MSVCRT__IOERR; file->_flag |= MSVCRT__IOERR;
return MSVCRT_EOF; return MSVCRT_EOF;
...@@ -2603,7 +2603,7 @@ MSVCRT_size_t CDECL MSVCRT_fread(void *ptr, MSVCRT_size_t size, MSVCRT_size_t nm ...@@ -2603,7 +2603,7 @@ MSVCRT_size_t CDECL MSVCRT_fread(void *ptr, MSVCRT_size_t size, MSVCRT_size_t nm
if (file->_bufsiz == 0) { if (file->_bufsiz == 0) {
msvcrt_alloc_buffer(file); msvcrt_alloc_buffer(file);
} }
file->_cnt = _read(file->_file, file->_base, file->_bufsiz); file->_cnt = MSVCRT__read(file->_file, file->_base, file->_bufsiz);
file->_ptr = file->_base; file->_ptr = file->_base;
i = (file->_cnt<rcnt) ? file->_cnt : rcnt; i = (file->_cnt<rcnt) ? file->_cnt : rcnt;
/* If the buffer fill reaches eof but fread wouldn't, clear eof. */ /* If the buffer fill reaches eof but fread wouldn't, clear eof. */
...@@ -2617,7 +2617,7 @@ MSVCRT_size_t CDECL MSVCRT_fread(void *ptr, MSVCRT_size_t size, MSVCRT_size_t nm ...@@ -2617,7 +2617,7 @@ MSVCRT_size_t CDECL MSVCRT_fread(void *ptr, MSVCRT_size_t size, MSVCRT_size_t nm
file->_ptr += i; file->_ptr += i;
} }
} else { } else {
i = _read(file->_file,ptr, rcnt); i = MSVCRT__read(file->_file,ptr, rcnt);
} }
pread += i; pread += i;
rcnt -= i; rcnt -= i;
...@@ -2660,7 +2660,7 @@ MSVCRT_FILE* CDECL MSVCRT_freopen(const char *path, const char *mode,MSVCRT_FILE ...@@ -2660,7 +2660,7 @@ MSVCRT_FILE* CDECL MSVCRT_freopen(const char *path, const char *mode,MSVCRT_FILE
file = NULL; file = NULL;
else else
{ {
fd = _open(path, open_flags, MSVCRT__S_IREAD | MSVCRT__S_IWRITE); fd = MSVCRT__open(path, open_flags, MSVCRT__S_IREAD | MSVCRT__S_IWRITE);
if (fd < 0) if (fd < 0)
file = NULL; file = NULL;
else if (msvcrt_init_fp(file, fd, stream_flags) == -1) else if (msvcrt_init_fp(file, fd, stream_flags) == -1)
...@@ -2980,7 +2980,7 @@ MSVCRT_FILE* CDECL MSVCRT_tmpfile(void) ...@@ -2980,7 +2980,7 @@ MSVCRT_FILE* CDECL MSVCRT_tmpfile(void)
MSVCRT_FILE* file = NULL; MSVCRT_FILE* file = NULL;
LOCK_FILES(); LOCK_FILES();
fd = _open(filename, MSVCRT__O_CREAT | MSVCRT__O_BINARY | MSVCRT__O_RDWR | MSVCRT__O_TEMPORARY); fd = MSVCRT__open(filename, MSVCRT__O_CREAT | MSVCRT__O_BINARY | MSVCRT__O_RDWR | MSVCRT__O_TEMPORARY);
if (fd != -1 && (file = msvcrt_alloc_fp())) if (fd != -1 && (file = msvcrt_alloc_fp()))
{ {
if (msvcrt_init_fp(file, fd, MSVCRT__O_RDWR) == -1) if (msvcrt_init_fp(file, fd, MSVCRT__O_RDWR) == -1)
......
...@@ -63,7 +63,7 @@ int CDECL MSVCRT_rand(void) ...@@ -63,7 +63,7 @@ int CDECL MSVCRT_rand(void)
/********************************************************************* /*********************************************************************
* _sleep (MSVCRT.@) * _sleep (MSVCRT.@)
*/ */
void CDECL _sleep(unsigned long timeout) void CDECL MSVCRT__sleep(unsigned long timeout)
{ {
TRACE("_sleep for %ld milliseconds\n",timeout); TRACE("_sleep for %ld milliseconds\n",timeout);
Sleep((timeout)?timeout:1); Sleep((timeout)?timeout:1);
......
...@@ -627,7 +627,7 @@ int MSVCRT_vsnwprintf(MSVCRT_wchar_t *str, unsigned int len, ...@@ -627,7 +627,7 @@ int MSVCRT_vsnwprintf(MSVCRT_wchar_t *str, unsigned int len,
int MSVCRT_raise(int sig); int MSVCRT_raise(int sig);
#ifndef __WINE_MSVCRT_TEST #ifndef __WINE_MSVCRT_TEST
int _write(int,const void*,unsigned int); int MSVCRT__write(int,const void*,unsigned int);
int _getch(void); int _getch(void);
int _ismbstrail(const unsigned char* start, const unsigned char* str); int _ismbstrail(const unsigned char* start, const unsigned char* str);
MSVCRT_intptr_t _spawnve(int,const char*,const char* const *,const char* const *); MSVCRT_intptr_t _spawnve(int,const char*,const char* const *,const char* const *);
...@@ -647,10 +647,10 @@ MSVCRT_wchar_t*** __p__wenviron(void); ...@@ -647,10 +647,10 @@ MSVCRT_wchar_t*** __p__wenviron(void);
char* _strdate(char* date); char* _strdate(char* date);
char* _strtime(char* date); char* _strtime(char* date);
void _ftime(struct MSVCRT__timeb *buf); void _ftime(struct MSVCRT__timeb *buf);
int _close(int); int MSVCRT__close(int);
int _dup(int); int MSVCRT__dup(int);
int _dup2(int, int); int MSVCRT__dup2(int, int);
int _pipe(int *, unsigned int, int); int MSVCRT__pipe(int *, unsigned int, int);
#endif #endif
#endif /* __WINE_MSVCRT_H */ #endif /* __WINE_MSVCRT_H */
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
@ cdecl __wgetmainargs(ptr ptr ptr long ptr) @ cdecl __wgetmainargs(ptr ptr ptr long ptr)
@ extern __winitenv MSVCRT___winitenv @ extern __winitenv MSVCRT___winitenv
@ cdecl _abnormal_termination() @ cdecl _abnormal_termination()
@ cdecl _access(str long) @ cdecl _access(str long) MSVCRT__access
@ extern _acmdln MSVCRT__acmdln @ extern _acmdln MSVCRT__acmdln
@ stdcall _adj_fdiv_m16i(long) @ stdcall _adj_fdiv_m16i(long)
@ stdcall _adj_fdiv_m32(long) @ stdcall _adj_fdiv_m32(long)
...@@ -181,14 +181,14 @@ ...@@ -181,14 +181,14 @@
@ cdecl _callnewh(long) @ cdecl _callnewh(long)
@ cdecl _cexit() MSVCRT__cexit @ cdecl _cexit() MSVCRT__cexit
@ cdecl _cgets(str) @ cdecl _cgets(str)
@ cdecl _chdir(str) @ cdecl _chdir(str) MSVCRT__chdir
@ cdecl _chdrive(long) @ cdecl _chdrive(long)
@ cdecl _chgsign( double ) @ cdecl _chgsign( double )
@ cdecl -i386 -norelay _chkesp() @ cdecl -i386 -norelay _chkesp()
@ cdecl _chmod(str long) @ cdecl _chmod(str long) MSVCRT__chmod
@ cdecl _chsize (long long) @ cdecl _chsize (long long)
@ cdecl _clearfp() @ cdecl _clearfp()
@ cdecl _close(long) @ cdecl _close(long) MSVCRT__close
@ cdecl _commit(long) @ cdecl _commit(long)
@ extern _commode MSVCRT__commode @ extern _commode MSVCRT__commode
@ cdecl _control87(long long) @ cdecl _control87(long long)
...@@ -196,14 +196,14 @@ ...@@ -196,14 +196,14 @@
@ cdecl _copysign( double double ) @ cdecl _copysign( double double )
@ varargs _cprintf(str) @ varargs _cprintf(str)
@ cdecl _cputs(str) @ cdecl _cputs(str)
@ cdecl _creat(str long) @ cdecl _creat(str long) MSVCRT__creat
@ varargs _cscanf(str) @ varargs _cscanf(str)
@ extern _ctype MSVCRT__ctype @ extern _ctype MSVCRT__ctype
@ cdecl _cwait(ptr long long) @ cdecl _cwait(ptr long long)
@ extern _daylight MSVCRT___daylight @ extern _daylight MSVCRT___daylight
@ extern _dstbias MSVCRT__dstbias @ extern _dstbias MSVCRT__dstbias
@ cdecl _dup (long) @ cdecl _dup (long) MSVCRT__dup
@ cdecl _dup2 (long long) @ cdecl _dup2 (long long) MSVCRT__dup2
@ cdecl _ecvt(double long ptr ptr) @ cdecl _ecvt(double long ptr ptr)
@ cdecl _endthread () @ cdecl _endthread ()
@ cdecl _endthreadex(long) @ cdecl _endthreadex(long)
...@@ -399,12 +399,12 @@ ...@@ -399,12 +399,12 @@
@ cdecl _mbsupr(str) @ cdecl _mbsupr(str)
@ cdecl _memccpy(ptr ptr long long) ntdll._memccpy @ cdecl _memccpy(ptr ptr long long) ntdll._memccpy
@ cdecl _memicmp(str str long) ntdll._memicmp @ cdecl _memicmp(str str long) ntdll._memicmp
@ cdecl _mkdir(str) @ cdecl _mkdir(str) MSVCRT__mkdir
@ cdecl _mktemp(str) @ cdecl _mktemp(str)
@ cdecl _msize(ptr) @ cdecl _msize(ptr)
@ cdecl _nextafter(double double) @ cdecl _nextafter(double double)
@ cdecl _onexit(ptr) MSVCRT__onexit @ cdecl _onexit(ptr) MSVCRT__onexit
@ varargs _open(str long) @ varargs _open(str long) MSVCRT__open
@ cdecl _open_osfhandle(long long) @ cdecl _open_osfhandle(long long)
@ extern _osver MSVCRT__osver @ extern _osver MSVCRT__osver
@ stub _outp #(long long) @ stub _outp #(long long)
...@@ -413,7 +413,7 @@ ...@@ -413,7 +413,7 @@
@ cdecl _pclose (ptr) MSVCRT__pclose @ cdecl _pclose (ptr) MSVCRT__pclose
@ extern _pctype MSVCRT__pctype @ extern _pctype MSVCRT__pctype
@ extern _pgmptr MSVCRT__pgmptr @ extern _pgmptr MSVCRT__pgmptr
@ cdecl _pipe (ptr long long) @ cdecl _pipe (ptr long long) MSVCRT__pipe
@ cdecl _popen (str str) MSVCRT__popen @ cdecl _popen (str str) MSVCRT__popen
@ cdecl _purecall() @ cdecl _purecall()
@ cdecl _putch(long) @ cdecl _putch(long)
...@@ -421,8 +421,8 @@ ...@@ -421,8 +421,8 @@
@ cdecl _putw(long ptr) MSVCRT__putw @ cdecl _putw(long ptr) MSVCRT__putw
@ cdecl _putws(wstr) @ cdecl _putws(wstr)
# extern _pwctype # extern _pwctype
@ cdecl _read(long ptr long) @ cdecl _read(long ptr long) MSVCRT__read
@ cdecl _rmdir(str) @ cdecl _rmdir(str) MSVCRT__rmdir
@ cdecl _rmtmp() @ cdecl _rmtmp()
@ cdecl _rotl(long long) @ cdecl _rotl(long long)
@ cdecl _rotr(long long) @ cdecl _rotr(long long)
...@@ -442,7 +442,7 @@ ...@@ -442,7 +442,7 @@
@ cdecl _setmbcp(long) @ cdecl _setmbcp(long)
@ cdecl _setmode(long long) @ cdecl _setmode(long long)
@ stub _setsystime #(ptr long) @ stub _setsystime #(ptr long)
@ cdecl _sleep(long) @ cdecl _sleep(long) MSVCRT__sleep
@ varargs _snprintf(str long str) MSVCRT__snprintf @ varargs _snprintf(str long str) MSVCRT__snprintf
@ varargs _snwprintf(wstr long wstr) MSVCRT__snwprintf @ varargs _snwprintf(wstr long wstr) MSVCRT__snwprintf
@ varargs _sopen(str long long) MSVCRT__sopen @ varargs _sopen(str long long) MSVCRT__sopen
...@@ -489,9 +489,9 @@ ...@@ -489,9 +489,9 @@
@ cdecl _ui64tow(long long ptr long) ntdll._ui64tow @ cdecl _ui64tow(long long ptr long) ntdll._ui64tow
@ cdecl _ultoa(long ptr long) ntdll._ultoa @ cdecl _ultoa(long ptr long) ntdll._ultoa
@ cdecl _ultow(long ptr long) ntdll._ultow @ cdecl _ultow(long ptr long) ntdll._ultow
@ cdecl _umask(long) @ cdecl _umask(long) MSVCRT__umask
@ cdecl _ungetch(long) @ cdecl _ungetch(long)
@ cdecl _unlink(str) @ cdecl _unlink(str) MSVCRT__unlink
@ cdecl _unloaddll(long) @ cdecl _unloaddll(long)
@ cdecl _unlock(long) @ cdecl _unlock(long)
@ cdecl _utime(str ptr) @ cdecl _utime(str ptr)
...@@ -549,7 +549,7 @@ ...@@ -549,7 +549,7 @@
@ cdecl _wputenv(wstr) @ cdecl _wputenv(wstr)
@ cdecl _wremove(wstr) @ cdecl _wremove(wstr)
@ cdecl _wrename(wstr wstr) @ cdecl _wrename(wstr wstr)
@ cdecl _write(long ptr long) @ cdecl _write(long ptr long) MSVCRT__write
@ cdecl _wrmdir(wstr) @ cdecl _wrmdir(wstr)
@ stub _wsearchenv #(wstr wstr ptr) @ stub _wsearchenv #(wstr wstr ptr)
@ cdecl _wsetlocale(long wstr) MSVCRT__wsetlocale @ cdecl _wsetlocale(long wstr) MSVCRT__wsetlocale
...@@ -770,7 +770,7 @@ ...@@ -770,7 +770,7 @@
@ cdecl wcstol(wstr ptr long) ntdll.wcstol @ cdecl wcstol(wstr ptr long) ntdll.wcstol
@ cdecl wcstombs(ptr ptr long) ntdll.wcstombs @ cdecl wcstombs(ptr ptr long) ntdll.wcstombs
@ cdecl wcstoul(wstr ptr long) ntdll.wcstoul @ cdecl wcstoul(wstr ptr long) ntdll.wcstoul
@ stub wcsxfrm #(ptr wstr long) @ stub wcsxfrm #(ptr wstr long) MSVCRT_wcsxfrm
@ cdecl wctomb(ptr long) MSVCRT_wctomb @ cdecl wctomb(ptr long) MSVCRT_wctomb
@ varargs wprintf(wstr) MSVCRT_wprintf @ varargs wprintf(wstr) MSVCRT_wprintf
@ varargs wscanf(wstr) MSVCRT_wscanf @ varargs wscanf(wstr) MSVCRT_wscanf
...@@ -565,25 +565,25 @@ MSVCRT_FILE* CDECL MSVCRT__popen(const char* command, const char* mode) ...@@ -565,25 +565,25 @@ MSVCRT_FILE* CDECL MSVCRT__popen(const char* command, const char* mode)
break; break;
} }
} }
if (_pipe(fds, 0, textmode) == -1) if (MSVCRT__pipe(fds, 0, textmode) == -1)
return NULL; return NULL;
fdToDup = readPipe ? 1 : 0; fdToDup = readPipe ? 1 : 0;
fdToOpen = readPipe ? 0 : 1; fdToOpen = readPipe ? 0 : 1;
if ((fdStdHandle = _dup(fdToDup)) == -1) if ((fdStdHandle = MSVCRT__dup(fdToDup)) == -1)
goto error; goto error;
if (_dup2(fds[fdToDup], fdToDup) != 0) if (MSVCRT__dup2(fds[fdToDup], fdToDup) != 0)
goto error; goto error;
if (readPipe) if (readPipe)
{ {
if ((fdStdErr = _dup(MSVCRT_STDERR_FILENO)) == -1) if ((fdStdErr = MSVCRT__dup(MSVCRT_STDERR_FILENO)) == -1)
goto error; goto error;
if (_dup2(fds[fdToDup], MSVCRT_STDERR_FILENO) != 0) if (MSVCRT__dup2(fds[fdToDup], MSVCRT_STDERR_FILENO) != 0)
goto error; goto error;
} }
_close(fds[fdToDup]); MSVCRT__close(fds[fdToDup]);
comSpecLen = GetEnvironmentVariableA(comSpec, NULL, 0); comSpecLen = GetEnvironmentVariableA(comSpec, NULL, 0);
if (!comSpecLen) if (!comSpecLen)
...@@ -596,30 +596,30 @@ MSVCRT_FILE* CDECL MSVCRT__popen(const char* command, const char* mode) ...@@ -596,30 +596,30 @@ MSVCRT_FILE* CDECL MSVCRT__popen(const char* command, const char* mode)
strcat(cmdcopy, command); strcat(cmdcopy, command);
if (msvcrt_spawn(MSVCRT__P_NOWAIT, NULL, cmdcopy, NULL) == -1) if (msvcrt_spawn(MSVCRT__P_NOWAIT, NULL, cmdcopy, NULL) == -1)
{ {
_close(fds[fdToOpen]); MSVCRT__close(fds[fdToOpen]);
ret = NULL; ret = NULL;
} }
else else
{ {
ret = MSVCRT__fdopen(fds[fdToOpen], mode); ret = MSVCRT__fdopen(fds[fdToOpen], mode);
if (!ret) if (!ret)
_close(fds[fdToOpen]); MSVCRT__close(fds[fdToOpen]);
} }
HeapFree(GetProcessHeap(), 0, cmdcopy); HeapFree(GetProcessHeap(), 0, cmdcopy);
_dup2(fdStdHandle, fdToDup); MSVCRT__dup2(fdStdHandle, fdToDup);
_close(fdStdHandle); MSVCRT__close(fdStdHandle);
if (readPipe) if (readPipe)
{ {
_dup2(fdStdErr, MSVCRT_STDERR_FILENO); MSVCRT__dup2(fdStdErr, MSVCRT_STDERR_FILENO);
_close(fdStdErr); MSVCRT__close(fdStdErr);
} }
return ret; return ret;
error: error:
if (fdStdHandle != -1) _close(fdStdHandle); if (fdStdHandle != -1) MSVCRT__close(fdStdHandle);
if (fdStdErr != -1) _close(fdStdErr); if (fdStdErr != -1) MSVCRT__close(fdStdErr);
_close(fds[0]); MSVCRT__close(fds[0]);
_close(fds[1]); MSVCRT__close(fds[1]);
return NULL; return NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment