From: Piotr Caban Subject: [PATCH 1/3] msvcrt: Fix compilation errors on Mingw (try2) Message-Id: <534E7BAC.9@codeweavers.com> Date: Wed, 16 Apr 2014 14:46:36 +0200 --- dlls/msvcrt/data.c | 14 +++++++------- dlls/msvcrt/dir.c | 12 ++++++------ dlls/msvcrt/file.c | 4 ++-- dlls/msvcrt/math.c | 6 +++--- dlls/msvcrt/misc.c | 2 +- dlls/msvcrt/msvcrt.h | 2 +- dlls/msvcrt/msvcrt.spec | 44 ++++++++++++++++++++++---------------------- dlls/msvcrt/printf.h | 2 +- dlls/msvcrt/string.c | 2 +- dlls/msvcrt/wcs.c | 6 +++--- 10 files changed, 47 insertions(+), 47 deletions(-) diff --git a/dlls/msvcrt/data.c b/dlls/msvcrt/data.c index 80e023a..e6989f1 100644 --- a/dlls/msvcrt/data.c +++ b/dlls/msvcrt/data.c @@ -141,7 +141,7 @@ typedef int (CDECL *_INITTERM_E_FN)(void); /*********************************************************************** * __p___argc (MSVCRT.@) */ -int* CDECL __p___argc(void) { return &MSVCRT___argc; } +int* CDECL MSVCRT___p___argc(void) { return &MSVCRT___argc; } /*********************************************************************** * __p__commode (MSVCRT.@) @@ -152,12 +152,12 @@ unsigned int* CDECL __p__commode(void) { return &MSVCRT__commode; } /*********************************************************************** * __p__pgmptr (MSVCRT.@) */ -char** CDECL __p__pgmptr(void) { return &MSVCRT__pgmptr; } +char** CDECL MSVCRT___p__pgmptr(void) { return &MSVCRT__pgmptr; } /*********************************************************************** * __p__wpgmptr (MSVCRT.@) */ -WCHAR** CDECL __p__wpgmptr(void) { return &MSVCRT__wpgmptr; } +WCHAR** CDECL MSVCRT___p__wpgmptr(void) { return &MSVCRT__wpgmptr; } /*********************************************************************** * _get_pgmptr (MSVCRT.@) @@ -188,7 +188,7 @@ unsigned int* CDECL __p__fmode(void) { return &MSVCRT__fmode; } /*********************************************************************** * _set_fmode (MSVCRT.@) */ -int CDECL _set_fmode(int mode) +int CDECL MSVCRT__set_fmode(int mode) { /* TODO: support _O_WTEXT */ if(!MSVCRT_CHECK_PMT(mode==MSVCRT__O_TEXT || mode==MSVCRT__O_BINARY)) @@ -201,7 +201,7 @@ int CDECL _set_fmode(int mode) /*********************************************************************** * _get_fmode (MSVCRT.@) */ -int CDECL _get_fmode(int *mode) +int CDECL MSVCRT__get_fmode(int *mode) { if(!MSVCRT_CHECK_PMT(mode)) return MSVCRT_EINVAL; @@ -243,12 +243,12 @@ MSVCRT_wchar_t** CDECL __p__wcmdln(void) { return &MSVCRT__wcmdln; } /********************************************************************* * __p___argv (MSVCRT.@) */ -char*** CDECL __p___argv(void) { return &MSVCRT___argv; } +char*** CDECL MSVCRT___p___argv(void) { return &MSVCRT___argv; } /********************************************************************* * __p___wargv (MSVCRT.@) */ -MSVCRT_wchar_t*** CDECL __p___wargv(void) { return &MSVCRT___wargv; } +MSVCRT_wchar_t*** CDECL MSVCRT___p___wargv(void) { return &MSVCRT___wargv; } /********************************************************************* * __p__environ (MSVCRT.@) diff --git a/dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c index d6dd661..3cf405f 100644 --- a/dlls/msvcrt/dir.c +++ b/dlls/msvcrt/dir.c @@ -1111,7 +1111,7 @@ do_error: /********************************************************************* * _splitpath (MSVCRT.@) */ -void CDECL _splitpath(const char *inpath, char *drv, char *dir, +void CDECL MSVCRT__splitpath(const char *inpath, char *drv, char *dir, char *fname, char *ext) { _splitpath_s(inpath, drv, drv?MSVCRT__MAX_DRIVE:0, dir, dir?MSVCRT__MAX_DIR:0, @@ -1205,7 +1205,7 @@ do_error: * * Unicode version of _splitpath. */ -void CDECL _wsplitpath(const MSVCRT_wchar_t *inpath, MSVCRT_wchar_t *drv, MSVCRT_wchar_t *dir, +void CDECL MSVCRT__wsplitpath(const MSVCRT_wchar_t *inpath, MSVCRT_wchar_t *drv, MSVCRT_wchar_t *dir, MSVCRT_wchar_t *fname, MSVCRT_wchar_t *ext) { _wsplitpath_s(inpath, drv, drv?MSVCRT__MAX_DRIVE:0, dir, dir?MSVCRT__MAX_DIR:0, @@ -1217,7 +1217,7 @@ void CDECL _wsplitpath(const MSVCRT_wchar_t *inpath, MSVCRT_wchar_t *drv, MSVCRT * * Unicode version of _fullpath. */ -MSVCRT_wchar_t * CDECL _wfullpath(MSVCRT_wchar_t * absPath, const MSVCRT_wchar_t* relPath, MSVCRT_size_t size) +MSVCRT_wchar_t * CDECL MSVCRT__wfullpath(MSVCRT_wchar_t * absPath, const MSVCRT_wchar_t* relPath, MSVCRT_size_t size) { DWORD rc; WCHAR* buffer; @@ -1271,7 +1271,7 @@ MSVCRT_wchar_t * CDECL _wfullpath(MSVCRT_wchar_t * absPath, const MSVCRT_wchar_t * Otherwise populates absPath with the path and returns it. * Failure: NULL. errno indicates the error. */ -char * CDECL _fullpath(char * absPath, const char* relPath, unsigned int size) +char * CDECL MSVCRT__fullpath(char * absPath, const char* relPath, unsigned int size) { DWORD rc; char* lastpart; @@ -1326,7 +1326,7 @@ char * CDECL _fullpath(char * absPath, const char* relPath, unsigned int size) * Nothing. If path is not large enough to hold the resulting pathname, * random process memory will be overwritten. */ -VOID CDECL _makepath(char * path, const char * drive, +VOID CDECL MSVCRT__makepath(char * path, const char * drive, const char *directory, const char * filename, const char * extension) { @@ -1373,7 +1373,7 @@ VOID CDECL _makepath(char * path, const char * drive, * * Unicode version of _wmakepath. */ -VOID CDECL _wmakepath(MSVCRT_wchar_t *path, const MSVCRT_wchar_t *drive, const MSVCRT_wchar_t *directory, +VOID CDECL MSVCRT__wmakepath(MSVCRT_wchar_t *path, const MSVCRT_wchar_t *drive, const MSVCRT_wchar_t *directory, const MSVCRT_wchar_t *filename, const MSVCRT_wchar_t *extension) { MSVCRT_wchar_t *p = path; diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 44629e2..997e1d5 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -1614,7 +1614,7 @@ int CDECL MSVCRT__fstat(int fd, struct MSVCRT__stat* buf) } /* _fstat32 - not exported in native msvcrt */ -int CDECL _fstat32(int fd, struct MSVCRT__stat32* buf) +int CDECL MSVCRT__fstat32(int fd, struct MSVCRT__stat32* buf) { int ret; struct MSVCRT__stat64 buf64; @@ -1626,7 +1626,7 @@ int CDECL _fstat32(int fd, struct MSVCRT__stat32* buf) } /* _fstat64i32 - not exported in native msvcrt */ -int CDECL _fstat64i32(int fd, struct MSVCRT__stat64i32* buf) +int CDECL MSVCRT__fstat64i32(int fd, struct MSVCRT__stat64i32* buf) { int ret; struct MSVCRT__stat64 buf64; diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 6af8776..65957d5 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -1338,7 +1338,7 @@ double CDECL MSVCRT__nextafter(double num, double next) /********************************************************************* * _ecvt (MSVCRT.@) */ -char * CDECL _ecvt( double number, int ndigits, int *decpt, int *sign ) +char * CDECL MSVCRT__ecvt( double number, int ndigits, int *decpt, int *sign ) { int prec, len; thread_data_t *data = msvcrt_get_thread_data(); @@ -1443,7 +1443,7 @@ int CDECL _ecvt_s( char *buffer, MSVCRT_size_t length, double number, int ndigit /*********************************************************************** * _fcvt (MSVCRT.@) */ -char * CDECL _fcvt( double number, int ndigits, int *decpt, int *sign ) +char * CDECL MSVCRT__fcvt( double number, int ndigits, int *decpt, int *sign ) { thread_data_t *data = msvcrt_get_thread_data(); int stop, dec1, dec2; @@ -1615,7 +1615,7 @@ int CDECL _fcvt_s(char* outbuffer, MSVCRT_size_t size, double number, int ndigit /*********************************************************************** * _gcvt (MSVCRT.@) */ -char * CDECL _gcvt( double number, int ndigit, char *buff ) +char * CDECL MSVCRT__gcvt( double number, int ndigit, char *buff ) { if(!buff) { *MSVCRT__errno() = MSVCRT_EINVAL; diff --git a/dlls/msvcrt/misc.c b/dlls/msvcrt/misc.c index 069f733..fab4680 100644 --- a/dlls/msvcrt/misc.c +++ b/dlls/msvcrt/misc.c @@ -305,7 +305,7 @@ void CDECL MSVCRT_qsort(void *base, MSVCRT_size_t nmemb, MSVCRT_size_t size, /********************************************************************* * _get_output_format (MSVCRT.@) */ -unsigned int CDECL _get_output_format(void) +unsigned int CDECL MSVCRT__get_output_format(void) { return output_format; } diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 4e41a7d..78b40ee 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -989,7 +989,7 @@ int __cdecl MSVCRT__toupper_l(int,MSVCRT__locale_t); int __cdecl MSVCRT__tolower_l(int,MSVCRT__locale_t); int __cdecl MSVCRT__strnicoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t); int __cdecl MSVCRT__strncoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t); -unsigned int __cdecl _get_output_format(void); +unsigned int __cdecl MSVCRT__get_output_format(void); char* __cdecl MSVCRT_strtok_s(char*, const char*, char**); /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd) diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index fa458a4..7cb42f2 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -245,11 +245,11 @@ @ cdecl -arch=i386 __libm_sse2_tan() @ cdecl -arch=i386 __libm_sse2_tanf() @ extern __mb_cur_max MSVCRT___mb_cur_max -@ cdecl __p___argc() -@ cdecl __p___argv() +@ cdecl __p___argc() MSVCRT___p___argc +@ cdecl __p___argv() MSVCRT___p___argv @ cdecl __p___initenv() @ cdecl __p___mb_cur_max() -@ cdecl __p___wargv() +@ cdecl __p___wargv() MSVCRT___p___wargv @ cdecl __p___winitenv() @ cdecl __p__acmdln() @ cdecl __p__amblksiz() @@ -264,7 +264,7 @@ @ cdecl __p__mbctype() @ cdecl __p__osver() @ cdecl __p__pctype() MSVCRT___p__pctype -@ cdecl __p__pgmptr() +@ cdecl __p__pgmptr() MSVCRT___p__pgmptr @ stub __p__pwctype() @ cdecl __p__timezone() MSVCRT___p__timezone @ cdecl __p__tzname() @@ -273,7 +273,7 @@ @ cdecl __p__winmajor() @ cdecl __p__winminor() @ cdecl __p__winver() -@ cdecl __p__wpgmptr() +@ cdecl __p__wpgmptr() MSVCRT___p__wpgmptr @ cdecl __pctype_func() MSVCRT___pctype_func @ extern __pioinfo MSVCRT___pioinfo # stub __pwctype_func() @@ -407,7 +407,7 @@ @ extern _dstbias MSVCRT__dstbias @ cdecl _dup (long) MSVCRT__dup @ cdecl _dup2 (long long) MSVCRT__dup2 -@ cdecl _ecvt(double long ptr ptr) +@ cdecl _ecvt(double long ptr ptr) MSVCRT__ecvt @ cdecl _ecvt_s(str long double long ptr ptr) @ cdecl _endthread () @ cdecl _endthreadex(long) @@ -429,7 +429,7 @@ @ cdecl _expand(ptr long) # stub _expand_dbg(ptr long long str long) @ cdecl _fcloseall() MSVCRT__fcloseall -@ cdecl _fcvt(double long ptr ptr) +@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt @ cdecl _fcvt_s(ptr long double long ptr ptr) @ cdecl _fdopen(long str) MSVCRT__fdopen @ cdecl _fgetchar() MSVCRT__fgetchar @@ -486,7 +486,7 @@ @ cdecl -arch=i386 -ret64 _ftol2() MSVCRT__ftol @ cdecl -arch=i386 -ret64 _ftol2_sse() MSVCRT__ftol #FIXME: SSE variant should be implemented # stub _ftol2_sse_excpt -@ cdecl _fullpath(ptr str long) +@ cdecl _fullpath(ptr str long) MSVCRT__fullpath # stub _fullpath_dbg(ptr str long long str long) @ cdecl _futime(long ptr) @ cdecl _futime32(long ptr) @@ -497,19 +497,19 @@ # stub _fwprintf_s_l(ptr wstr ptr) @ varargs _fwscanf_l(ptr wstr ptr) MSVCRT__fwscanf_l @ varargs _fwscanf_s_l(ptr wstr ptr) MSVCRT__fwscanf_s_l -@ cdecl _gcvt(double long str) +@ cdecl _gcvt(double long str) MSVCRT__gcvt @ cdecl _gcvt_s(ptr long double long) @ cdecl _get_current_locale() MSVCRT__get_current_locale @ cdecl _get_doserrno(ptr) # stub _get_environ(ptr) @ cdecl _get_errno(ptr) # stub _get_fileinfo(ptr) -@ cdecl _get_fmode(ptr) +@ cdecl _get_fmode(ptr) MSVCRT__get_fmode @ cdecl _get_heap_handle() @ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle @ cdecl _get_osplatform(ptr) MSVCRT__get_osplatform # stub _get_osver(ptr) -@ cdecl _get_output_format() +@ cdecl _get_output_format() MSVCRT__get_output_format @ cdecl _get_pgmptr(ptr) @ cdecl _get_sbh_threshold() # stub _get_wenviron(ptr) @@ -646,7 +646,7 @@ # stub _iswupper_l(long ptr) # stub _iswxdigit_l(long ptr) @ cdecl _isxdigit_l(long ptr) MSVCRT__isxdigit_l -@ cdecl _itoa(long ptr long) +@ cdecl _itoa(long ptr long) MSVCRT__itoa @ cdecl _itoa_s(long ptr long long) @ cdecl _itow(long ptr long) ntdll._itow @ cdecl _itow_s(long ptr long long) @@ -680,7 +680,7 @@ @ cdecl _ltoa_s(long ptr long long) @ cdecl _ltow(long ptr long) ntdll._ltow @ cdecl _ltow_s(long ptr long long) -@ cdecl _makepath(ptr str str str str) +@ cdecl _makepath(ptr str str str str) MSVCRT__makepath @ cdecl _makepath_s(ptr long str str str str) # stub _malloc_dbg(long long str long) @ cdecl _matherr(ptr) MSVCRT__matherr @@ -897,7 +897,7 @@ @ cdecl _set_errno(long) @ cdecl _set_error_mode(long) # stub _set_fileinfo(long) -@ cdecl _set_fmode(long) +@ cdecl _set_fmode(long) MSVCRT__set_fmode @ cdecl _set_output_format(long) @ cdecl _set_sbh_threshold(long) @ cdecl _seterrormode(long) @@ -937,7 +937,7 @@ @ cdecl _spawnve(long str ptr ptr) MSVCRT__spawnve @ cdecl _spawnvp(long str ptr) @ cdecl _spawnvpe(long str ptr ptr) MSVCRT__spawnvpe -@ cdecl _splitpath(str ptr ptr ptr ptr) +@ cdecl _splitpath(str ptr ptr ptr ptr) MSVCRT__splitpath @ cdecl _splitpath_s(str ptr long ptr long ptr long ptr long) @ varargs _sprintf_l(ptr str ptr) MSVCRT_sprintf_l @ varargs _sprintf_p_l(ptr long str ptr) MSVCRT_sprintf_p_l @@ -1167,7 +1167,7 @@ @ cdecl _wfreopen(wstr wstr ptr) MSVCRT__wfreopen @ cdecl _wfreopen_s(ptr wstr wstr ptr) MSVCRT__wfreopen_s @ cdecl _wfsopen(wstr wstr long) MSVCRT__wfsopen -@ cdecl _wfullpath(ptr wstr long) +@ cdecl _wfullpath(ptr wstr long) MSVCRT__wfullpath # stub _wfullpath_dbg(ptr wstr long long str long) @ cdecl _wgetcwd(wstr long) MSVCRT__wgetcwd @ cdecl _wgetdcwd(long wstr long) MSVCRT__wgetdcwd @@ -1177,7 +1177,7 @@ @ extern _winminor MSVCRT__winminor # stub _winput_s @ extern _winver MSVCRT__winver -@ cdecl _wmakepath(ptr wstr wstr wstr wstr) +@ cdecl _wmakepath(ptr wstr wstr wstr wstr) MSVCRT__wmakepath @ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr) @ cdecl _wmkdir(wstr) MSVCRT__wmkdir @ cdecl _wmktemp(wstr) MSVCRT__wmktemp @@ -1212,7 +1212,7 @@ @ cdecl _wspawnve(long wstr ptr ptr) MSVCRT__wspawnve @ cdecl _wspawnvp(long wstr ptr) @ cdecl _wspawnvpe(long wstr ptr ptr) MSVCRT__wspawnvpe -@ cdecl _wsplitpath(wstr ptr ptr ptr ptr) +@ cdecl _wsplitpath(wstr ptr ptr ptr ptr) MSVCRT__wsplitpath @ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long) _wsplitpath_s @ cdecl _wstat(wstr ptr) MSVCRT__wstat @ cdecl _wstati64(wstr ptr) MSVCRT__wstati64 @@ -1229,8 +1229,8 @@ @ cdecl _wtof(wstr) MSVCRT__wtof @ cdecl _wtof_l(wstr ptr) MSVCRT__wtof_l @ cdecl _wtoi(wstr) MSVCRT__wtoi -@ cdecl -ret64 _wtoi64(wstr) -@ cdecl -ret64 _wtoi64_l(wstr ptr) +@ cdecl -ret64 _wtoi64(wstr) MSVCRT__wtoi64 +@ cdecl -ret64 _wtoi64_l(wstr ptr) MSVCRT__wtoi64_l @ cdecl _wtoi_l(wstr ptr) MSVCRT__wtoi_l @ cdecl _wtol(wstr) MSVCRT__wtol @ cdecl _wtol_l(wstr ptr) MSVCRT__wtol_l @@ -1535,7 +1535,7 @@ @ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output @ cdecl _getptd() @ cdecl fread_s(ptr long long long ptr) -@ cdecl _fstat32(long ptr) -@ cdecl _fstat64i32(long ptr) +@ cdecl _fstat32(long ptr) MSVCRT__fstat32 +@ cdecl _fstat64i32(long ptr) MSVCRT__fstat64i32 @ cdecl _is_exception_typeof(ptr ptr) @ cdecl -arch=i386 __libm_sse2_sqrt_precise() diff --git a/dlls/msvcrt/printf.h b/dlls/msvcrt/printf.h index a462f3a..8a41d3e 100644 --- a/dlls/msvcrt/printf.h +++ b/dlls/msvcrt/printf.h @@ -309,7 +309,7 @@ static inline void FUNC_NAME(pf_fixup_exponent)(char *buf) if(tmp[0] && (tmp[1]=='+' || tmp[1]=='-') && isdigit(tmp[2]) && isdigit(tmp[3])) { - BOOL two_digit_exp = (_get_output_format() == MSVCRT__TWO_DIGIT_EXPONENT); + BOOL two_digit_exp = (MSVCRT__get_output_format() == MSVCRT__TWO_DIGIT_EXPONENT); tmp += 2; if(isdigit(tmp[2])) { diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 446c119..5432495 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -1154,7 +1154,7 @@ int CDECL _itoa_s(int value, char *str, MSVCRT_size_t size, int radix) /********************************************************************* * _itoa (MSVCRT.@) */ -char* CDECL _itoa(int value, char *str, int radix) +char* CDECL MSVCRT__itoa(int value, char *str, int radix) { return ltoa_helper(value, str, MSVCRT_SIZE_MAX, radix) ? NULL : str; } diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 1b00b41..bfd2072 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1946,7 +1946,7 @@ MSVCRT_wchar_t* CDECL MSVCRT_wcsstr(const MSVCRT_wchar_t *str, const MSVCRT_wcha /********************************************************************* * _wtoi64_l (MSVCRT.@) */ -__int64 CDECL _wtoi64_l(const MSVCRT_wchar_t *str, MSVCRT__locale_t locale) +__int64 CDECL MSVCRT__wtoi64_l(const MSVCRT_wchar_t *str, MSVCRT__locale_t locale) { ULONGLONG RunningTotal = 0; BOOL bMinus = FALSE; @@ -1973,9 +1973,9 @@ __int64 CDECL _wtoi64_l(const MSVCRT_wchar_t *str, MSVCRT__locale_t locale) /********************************************************************* * _wtoi64 (MSVCRT.@) */ -__int64 CDECL _wtoi64(const MSVCRT_wchar_t *str) +__int64 CDECL MSVCRT__wtoi64(const MSVCRT_wchar_t *str) { - return _wtoi64_l(str, NULL); + return MSVCRT__wtoi64_l(str, NULL); } /*********************************************************************