msvcp90: Depend on compiler to handle returning struct in _Getctype.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2021-05-20 21:37:26 +02:00 committed by Alexandre Julliard
parent 83cc0110f2
commit dff8564651
12 changed files with 25 additions and 23 deletions

View File

@ -2916,7 +2916,7 @@
# extern _FXbig
@ stub _GetLocaleForCP
@ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr)
@ cdecl -norelay _Getctype()
@ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr)

View File

@ -3779,7 +3779,7 @@
@ stub _FXp_subx
# extern _FZero
@ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr)
@ cdecl -norelay _Getctype()
@ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr)

View File

@ -3722,7 +3722,7 @@
@ stub _FXp_subx
# extern _FZero
@ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr)
@ cdecl -norelay _Getctype()
@ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr)

View File

@ -3722,7 +3722,7 @@
@ stub _FXp_subx
# extern _FZero
@ cdecl -norelay _Getcoll() msvcp120._Getcoll
@ cdecl _Getctype(ptr) msvcp120._Getctype
@ cdecl -norelay _Getctype() msvcp120._Getctype
@ cdecl -norelay _Getcvt() msvcp120._Getcvt
@ cdecl _Getdateorder() msvcp120._Getdateorder
@ cdecl _Getwctype(long ptr) msvcp120._Getwctype

View File

@ -3650,7 +3650,7 @@
@ extern _FSnan
@ cdecl _File_size(wstr)
@ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr)
@ cdecl -norelay _Getctype()
@ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr)

View File

@ -4275,7 +4275,7 @@
@ extern _FSnan _FSnan
# extern _FXbig
@ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr)
@ cdecl -norelay _Getctype()
@ cdecl -norelay _Getcvt()
@ extern _Hugeval _Hugeval
@ extern _Inf _Inf

View File

@ -5062,7 +5062,7 @@
# extern _FXbig
# extern _FZero
@ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr)
@ cdecl -norelay _Getctype()
@ cdecl -norelay _Getcvt()
@ extern _Hugeval
@ extern _Inf

View File

@ -5116,7 +5116,7 @@
# extern _FXbig
# extern _FZero
@ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr)
@ cdecl -norelay _Getctype()
@ cdecl -norelay _Getcvt()
@ cdecl _Getwctype(long ptr)
@ cdecl _Getwctypes(ptr ptr ptr ptr)

View File

@ -5725,7 +5725,7 @@
@ extern _FSnan
# extern _FXbig
@ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr)
@ cdecl -norelay _Getctype()
@ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr)

View File

@ -698,8 +698,9 @@ _Collvec* __thiscall _Locinfo__Getcoll(const _Locinfo *this, _Collvec *ret)
}
/* _Getctype */
_Ctypevec* __cdecl _Getctype(_Ctypevec *ret)
_Ctypevec __cdecl _Getctype(void)
{
_Ctypevec ret;
short *table;
#if _MSVCP_VER >= 110
wchar_t *name;
@ -708,24 +709,24 @@ _Ctypevec* __cdecl _Getctype(_Ctypevec *ret)
TRACE("\n");
ret->page = ___lc_codepage_func();
ret.page = ___lc_codepage_func();
#if _MSVCP_VER < 110
ret->handle = ___lc_handle_func()[LC_COLLATE];
ret.handle = ___lc_handle_func()[LC_COLLATE];
#else
if((name = ___lc_locale_name_func()[LC_COLLATE])) {
size = wcslen(name)+1;
ret->name = malloc(size*sizeof(*name));
if(!ret->name) throw_exception(EXCEPTION_BAD_ALLOC, NULL);
memcpy(ret->name, name, size*sizeof(*name));
ret.name = malloc(size*sizeof(*name));
if(!ret.name) throw_exception(EXCEPTION_BAD_ALLOC, NULL);
memcpy(ret.name, name, size*sizeof(*name));
} else {
ret->name = NULL;
ret.name = NULL;
}
#endif
ret->delfl = TRUE;
ret.delfl = TRUE;
table = malloc(sizeof(short[256]));
if(!table) throw_exception(EXCEPTION_BAD_ALLOC, NULL);
memcpy(table, __pctype_func(), sizeof(short[256]));
ret->table = table;
ret.table = table;
return ret;
}
@ -734,7 +735,8 @@ _Ctypevec* __cdecl _Getctype(_Ctypevec *ret)
DEFINE_THISCALL_WRAPPER(_Locinfo__Getctype, 8)
_Ctypevec* __thiscall _Locinfo__Getctype(const _Locinfo *this, _Ctypevec *ret)
{
return _Getctype(ret);
*ret = _Getctype();
return ret;
}
/* _Getcvt */

View File

@ -6501,7 +6501,7 @@
@ extern _FSnan
# extern _FXbig
@ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr)
@ cdecl -norelay _Getctype()
@ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr)

View File

@ -100,7 +100,7 @@ static BYTE (__cdecl *p_short_eq)(const void*, const void*);
static char* (__cdecl *p_Copy_s)(char*, size_t, const char*, size_t);
static unsigned short (__cdecl *p_wctype)(const char*);
static MSVCP__Ctypevec* (__cdecl *p__Getctype)(MSVCP__Ctypevec*);
static MSVCP__Ctypevec (__cdecl *p__Getctype)(void);
static MSVCP__Collvec (__cdecl *p__Getcoll)(void);
static wctrans_t (__cdecl *p_wctrans)(const char*);
static wint_t (__cdecl *p_towctrans)(wint_t, wctrans_t);
@ -584,7 +584,7 @@ static void test__Getctype(void)
MSVCP__Ctypevec ret;
_locale_t locale;
ok(p__Getctype(&ret) == &ret, "__Getctype returned incorrect pointer\n");
ret = p__Getctype();
ok(ret.handle == 0, "ret.handle = %d\n", ret.handle);
ok(ret.page == 0, "ret.page = %d\n", ret.page);
ok(ret.delfl == 1, "ret.delfl = %d\n", ret.delfl);
@ -594,7 +594,7 @@ static void test__Getctype(void)
locale = p__get_current_locale();
locale->locinfo->lc_handle[LC_COLLATE] = 0x1234567;
p__free_locale(locale);
ok(p__Getctype(&ret) == &ret, "__Getctype returned incorrect pointer\n");
ret = p__Getctype();
ok(ret.handle == 0x1234567, "ret.handle = %d\n", ret.handle);
ok(ret.page == 0, "ret.page = %d\n", ret.page);
ok(ret.delfl == 1, "ret.delfl = %d\n", ret.delfl);