From b90320652d94f31d0e4d8722568ca2826cf929c9 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Mon, 29 Mar 2010 00:00:26 +0200 Subject: [PATCH] msvcrt: Rename functions conflicting with mingw headers. --- dlls/msvcrt/file.c | 10 +++++----- dlls/msvcrt/math.c | 6 +++--- dlls/msvcrt/mbcs.c | 2 +- dlls/msvcrt/msvcrt.h | 7 ++++--- dlls/msvcrt/msvcrt.spec | 20 ++++++++++---------- dlls/msvcrt/process.c | 14 +++++++------- dlls/msvcrt/string.c | 2 +- dlls/msvcrt/wcs.c | 2 +- 8 files changed, 32 insertions(+), 31 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 9dc1b54fdc..7e3c217df1 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -962,7 +962,7 @@ int CDECL MSVCRT_fseek(MSVCRT_FILE* file, MSVCRT_long offset, int whence) /********************************************************************* * _chsize (MSVCRT.@) */ -int CDECL _chsize(int fd, MSVCRT_long size) +int CDECL MSVCRT__chsize(int fd, MSVCRT_long size) { LONG cur, pos; HANDLE handle; @@ -2049,7 +2049,7 @@ int CDECL MSVCRT__wstat(const MSVCRT_wchar_t* path, struct MSVCRT__stat * buf) /********************************************************************* * _tell (MSVCRT.@) */ -MSVCRT_long CDECL _tell(int fd) +MSVCRT_long CDECL MSVCRT__tell(int fd) { return MSVCRT__lseek(fd, 0, SEEK_CUR); } @@ -2817,7 +2817,7 @@ MSVCRT_size_t CDECL MSVCRT_fread(void *ptr, MSVCRT_size_t size, MSVCRT_size_t nm * _wfreopen (MSVCRT.@) * */ -MSVCRT_FILE* CDECL _wfreopen(const MSVCRT_wchar_t *path, const MSVCRT_wchar_t *mode, MSVCRT_FILE* file) +MSVCRT_FILE* CDECL MSVCRT__wfreopen(const MSVCRT_wchar_t *path, const MSVCRT_wchar_t *mode, MSVCRT_FILE* file) { int open_flags, stream_flags, fd; @@ -2866,7 +2866,7 @@ MSVCRT_FILE* CDECL MSVCRT_freopen(const char *path, const char *mode, MSVCRT_FIL return NULL; } - ret = _wfreopen(pathW, modeW, file); + ret = MSVCRT__wfreopen(pathW, modeW, file); MSVCRT_free(pathW); MSVCRT_free(modeW); @@ -2902,7 +2902,7 @@ LONG CDECL MSVCRT_ftell(MSVCRT_FILE* file) /* TODO: just call fgetpos and return lower half of result */ int off=0; MSVCRT_long pos; - pos = _tell(file->_file); + pos = MSVCRT__tell(file->_file); if(pos == -1) return -1; if(file->_bufsiz) { if( file->_flag & MSVCRT__IOWRT ) { diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 315cdcdf5a..ae408b9fde 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -436,7 +436,7 @@ double CDECL _logb(double num) /********************************************************************* * _lrotl (MSVCRT.@) */ -MSVCRT_ulong CDECL _lrotl(MSVCRT_ulong num, int shift) +MSVCRT_ulong CDECL MSVCRT__lrotl(MSVCRT_ulong num, int shift) { shift &= 0x1f; return (num << shift) | (num >> (32-shift)); @@ -445,7 +445,7 @@ MSVCRT_ulong CDECL _lrotl(MSVCRT_ulong num, int shift) /********************************************************************* * _lrotr (MSVCRT.@) */ -MSVCRT_ulong CDECL _lrotr(MSVCRT_ulong num, int shift) +MSVCRT_ulong CDECL MSVCRT__lrotr(MSVCRT_ulong num, int shift) { shift &= 0x1f; return (num >> shift) | (num << (32-shift)); @@ -463,7 +463,7 @@ unsigned int CDECL _rotr(unsigned int num, int shift) /********************************************************************* * _scalb (MSVCRT.@) */ -double CDECL _scalb(double num, MSVCRT_long power) +double CDECL MSVCRT__scalb(double num, MSVCRT_long power) { /* Note - Can't forward directly as libc expects y as double */ double dblpower = (double)power; diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index e0ce3e2bd9..302b54e979 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -145,7 +145,7 @@ static inline unsigned char *u__strset( unsigned char *s, unsigned char c ) static inline unsigned char *u__strnset( unsigned char *s, unsigned char c, MSVCRT_size_t len ) { - return (unsigned char*) _strnset( (char*)s, c, len ); + return (unsigned char*) MSVCRT__strnset( (char*)s, c, len ); } static inline MSVCRT_size_t u_strcspn( const unsigned char *s, const unsigned char *rej ) diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 1000f3ddb2..6df324e05b 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -744,14 +744,14 @@ int __cdecl MSVCRT__write(int,const void*,unsigned int); int __cdecl _getch(void); int __cdecl _ismbblead(unsigned int); int __cdecl _ismbstrail(const unsigned char* start, const unsigned char* str); -MSVCRT_intptr_t __cdecl _spawnve(int,const char*,const char* const *,const char* const *); -MSVCRT_intptr_t __cdecl _spawnvpe(int,const char*,const char* const *,const char* const *); +MSVCRT_intptr_t __cdecl MSVCRT__spawnve(int,const char*,const char* const *,const char* const *); +MSVCRT_intptr_t __cdecl MSVRT__spawnvpe(int,const char*,const char* const *,const char* const *); MSVCRT_intptr_t __cdecl _wspawnve(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *); MSVCRT_intptr_t __cdecl _wspawnvpe(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *); void __cdecl _searchenv(const char*,const char*,char*); int __cdecl _getdrive(void); char* __cdecl _strdup(const char*); -char* __cdecl _strnset(char*,int,MSVCRT_size_t); +char* __cdecl MSVCRT__strnset(char*,int,MSVCRT_size_t); char* __cdecl _strset(char*,int); int __cdecl _ungetch(int); int __cdecl _cputs(const char*); @@ -770,6 +770,7 @@ int __cdecl MSVCRT__dup2(int, int); int __cdecl MSVCRT__pipe(int *, unsigned int, int); MSVCRT_wchar_t* __cdecl _wgetenv(const MSVCRT_wchar_t*); void __cdecl _wsearchenv(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_wchar_t*); +MSVCRT_intptr_t __cdecl MSVCRT__spawnvpe(int, const char*, const char* const*, const char* const*); #endif #endif /* __WINE_MSVCRT_H */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index bee7ba1947..5eec07f929 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -289,7 +289,7 @@ @ cdecl _chgsign( double ) @ cdecl -i386 -norelay _chkesp() @ cdecl _chmod(str long) MSVCRT__chmod -@ cdecl _chsize (long long) +@ cdecl _chsize(long long) MSVCRT__chsize # stub _chsize_s # stub _chvalidator # stub _chvalidator_l @@ -587,8 +587,8 @@ @ cdecl _locking(long long long) MSVCRT__locking @ cdecl _logb( double ) @ cdecl -i386 _longjmpex(ptr long) MSVCRT_longjmp -@ cdecl _lrotl(long long) -@ cdecl _lrotr(long long) +@ cdecl _lrotl(long long) MSVCRT__lrotl +@ cdecl _lrotr(long long) MSVCRT__lrotr @ cdecl _lsearch(ptr ptr long long ptr) # stub _lsearch_s @ cdecl _lseek(long long long) MSVCRT__lseek @@ -792,7 +792,7 @@ @ cdecl -arch=i386 _safe_fdivr() @ cdecl -arch=i386 _safe_fprem() @ cdecl -arch=i386 _safe_fprem1() -@ cdecl _scalb( double long) +@ cdecl _scalb(double long) MSVCRT__scalb # stub _scanf_l # stub _scanf_s_l # stub _scprintf @@ -847,9 +847,9 @@ @ varargs _spawnlp(long str str) @ varargs _spawnlpe(long str str) @ cdecl _spawnv(long str ptr) -@ cdecl _spawnve(long str ptr ptr) +@ cdecl _spawnve(long str ptr ptr) MSVCRT__spawnve @ cdecl _spawnvp(long str ptr) -@ cdecl _spawnvpe(long str ptr ptr) +@ cdecl _spawnvpe(long str ptr ptr) MSVCRT__spawnvpe @ cdecl _splitpath(str ptr ptr ptr ptr) ntdll._splitpath # stub _splitpath_s # stub _sprintf_l @@ -883,7 +883,7 @@ # stub _strnicmp_l @ stub _strnicoll #(str str long) # stub _strnicoll_l -@ cdecl _strnset(str long long) +@ cdecl _strnset(str long long) MSVCRT__strnset # stub _strnset_s @ cdecl _strrev(str) @ cdecl _strset(str long) @@ -912,7 +912,7 @@ # stub _swscanf_s_l @ extern _sys_errlist MSVCRT__sys_errlist @ extern _sys_nerr MSVCRT__sys_nerr -@ cdecl _tell(long) +@ cdecl _tell(long) MSVCRT__tell @ cdecl -ret64 _telli64(long) @ cdecl _tempnam(str str) # stub _tempnam_dbg @@ -1028,7 +1028,7 @@ # stub _wcsnicmp_l @ stub _wcsnicoll #(wstr wstr long) # stub _wcsnicoll_l -@ cdecl _wcsnset(wstr long long) +@ cdecl _wcsnset(wstr long long) MSVCRT__wcsnset # stub _wcsnset_s @ cdecl _wcsrev(wstr) @ cdecl _wcsset(wstr long) @@ -1072,7 +1072,7 @@ @ cdecl _wfindnexti64(long ptr) MSVCRT__wfindnexti64 @ cdecl _wfopen(wstr wstr) MSVCRT__wfopen # stub _wfopen_s -@ cdecl _wfreopen(wstr wstr ptr) +@ cdecl _wfreopen(wstr wstr ptr) MSVCRT__wfreopen # stub _wfreopen_s @ cdecl _wfsopen(wstr wstr long) MSVCRT__wfsopen @ cdecl _wfullpath(ptr wstr long) diff --git a/dlls/msvcrt/process.c b/dlls/msvcrt/process.c index 0b1eb01d27..564c10052d 100644 --- a/dlls/msvcrt/process.c +++ b/dlls/msvcrt/process.c @@ -612,7 +612,7 @@ MSVCRT_intptr_t CDECL _wexecv(const MSVCRT_wchar_t* name, MSVCRT_wchar_t* const* */ MSVCRT_intptr_t CDECL _execv(const char* name, char* const* argv) { - return _spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, NULL); + return MSVCRT__spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, NULL); } /********************************************************************* @@ -633,7 +633,7 @@ MSVCRT_intptr_t CDECL _wexecve(const MSVCRT_wchar_t* name, MSVCRT_wchar_t* const */ MSVCRT_intptr_t CDECL MSVCRT__execve(const char* name, char* const* argv, const char* const* envv) { - return _spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, envv); + return MSVCRT__spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, envv); } /********************************************************************* @@ -654,7 +654,7 @@ MSVCRT_intptr_t CDECL _wexecvpe(const MSVCRT_wchar_t* name, MSVCRT_wchar_t* cons */ MSVCRT_intptr_t CDECL _execvpe(const char* name, char* const* argv, const char* const* envv) { - return _spawnvpe(MSVCRT__P_OVERLAY, name, (const char* const*) argv, envv); + return MSVCRT__spawnvpe(MSVCRT__P_OVERLAY, name, (const char* const*) argv, envv); } /********************************************************************* @@ -894,7 +894,7 @@ MSVCRT_intptr_t CDECL _spawnlpe(int flags, const char* name, const char* arg0, . * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -MSVCRT_intptr_t CDECL _spawnve(int flags, const char* name, const char* const* argv, +MSVCRT_intptr_t CDECL MSVCRT__spawnve(int flags, const char* name, const char* const* argv, const char* const* envv) { MSVCRT_wchar_t *nameW, *args, *envs; @@ -942,7 +942,7 @@ MSVCRT_intptr_t CDECL _wspawnve(int flags, const MSVCRT_wchar_t* name, const MSV */ MSVCRT_intptr_t CDECL _spawnv(int flags, const char* name, const char* const* argv) { - return _spawnve(flags, name, argv, NULL); + return MSVCRT__spawnve(flags, name, argv, NULL); } /********************************************************************* @@ -961,7 +961,7 @@ MSVCRT_intptr_t CDECL _wspawnv(int flags, const MSVCRT_wchar_t* name, const MSVC * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -MSVCRT_intptr_t CDECL _spawnvpe(int flags, const char* name, const char* const* argv, +MSVCRT_intptr_t CDECL MSVCRT__spawnvpe(int flags, const char* name, const char* const* argv, const char* const* envv) { MSVCRT_wchar_t *nameW, *args, *envs; @@ -1009,7 +1009,7 @@ MSVCRT_intptr_t CDECL _wspawnvpe(int flags, const MSVCRT_wchar_t* name, const MS */ MSVCRT_intptr_t CDECL _spawnvp(int flags, const char* name, const char* const* argv) { - return _spawnvpe(flags, name, argv, NULL); + return MSVCRT__spawnvpe(flags, name, argv, NULL); } /********************************************************************* diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 2a7c9afd2d..e3c36d296f 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -49,7 +49,7 @@ char* CDECL _strdup(const char* str) /********************************************************************* * _strnset (MSVCRT.@) */ -char* CDECL _strnset(char* str, int value, MSVCRT_size_t len) +char* CDECL MSVCRT__strnset(char* str, int value, MSVCRT_size_t len) { if (len > 0 && str) while (*str && len--) diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 2a1dd256b4..d7b0058124 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -57,7 +57,7 @@ INT CDECL _wcsicoll( const MSVCRT_wchar_t* str1, const MSVCRT_wchar_t* str2 ) /********************************************************************* * _wcsnset (MSVCRT.@) */ -MSVCRT_wchar_t* CDECL _wcsnset( MSVCRT_wchar_t* str, MSVCRT_wchar_t c, MSVCRT_size_t n ) +MSVCRT_wchar_t* CDECL MSVCRT__wcsnset( MSVCRT_wchar_t* str, MSVCRT_wchar_t c, MSVCRT_size_t n ) { MSVCRT_wchar_t* ret = str; while ((n-- > 0) && *str) *str++ = c;