msvcp90: Depend on compiler in _Getcoll implementation if possible.

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:23 +02:00 committed by Alexandre Julliard
parent 24f7abafd7
commit 83cc0110f2
12 changed files with 31 additions and 31 deletions

View File

@ -2915,7 +2915,7 @@
@ extern _FSnan @ extern _FSnan
# extern _FXbig # extern _FXbig
@ stub _GetLocaleForCP @ stub _GetLocaleForCP
@ cdecl -ret64 _Getcoll() @ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -norelay _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()

View File

@ -3778,7 +3778,7 @@
@ stub _FXp_sqrtx @ stub _FXp_sqrtx
@ stub _FXp_subx @ stub _FXp_subx
# extern _FZero # extern _FZero
@ cdecl -ret64 _Getcoll() @ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -norelay _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()

View File

@ -3721,7 +3721,7 @@
@ stub _FXp_sqrtx @ stub _FXp_sqrtx
@ stub _FXp_subx @ stub _FXp_subx
# extern _FZero # extern _FZero
@ cdecl -ret64 _Getcoll() @ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -norelay _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()

View File

@ -3721,7 +3721,7 @@
@ stub _FXp_sqrtx @ stub _FXp_sqrtx
@ stub _FXp_subx @ stub _FXp_subx
# extern _FZero # extern _FZero
@ cdecl -ret64 _Getcoll() msvcp120._Getcoll @ cdecl -norelay _Getcoll() msvcp120._Getcoll
@ cdecl _Getctype(ptr) msvcp120._Getctype @ cdecl _Getctype(ptr) msvcp120._Getctype
@ cdecl -norelay _Getcvt() msvcp120._Getcvt @ cdecl -norelay _Getcvt() msvcp120._Getcvt
@ cdecl _Getdateorder() msvcp120._Getdateorder @ cdecl _Getdateorder() msvcp120._Getdateorder

View File

@ -3649,7 +3649,7 @@
@ stub _FSinh @ stub _FSinh
@ extern _FSnan @ extern _FSnan
@ cdecl _File_size(wstr) @ cdecl _File_size(wstr)
@ cdecl -ret64 _Getcoll() @ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -norelay _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()

View File

@ -4274,7 +4274,7 @@
@ stub _FSinh @ stub _FSinh
@ extern _FSnan _FSnan @ extern _FSnan _FSnan
# extern _FXbig # extern _FXbig
@ cdecl -ret64 _Getcoll() @ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -norelay _Getcvt() @ cdecl -norelay _Getcvt()
@ extern _Hugeval _Hugeval @ extern _Hugeval _Hugeval

View File

@ -5061,7 +5061,7 @@
@ extern _FSnan @ extern _FSnan
# extern _FXbig # extern _FXbig
# extern _FZero # extern _FZero
@ cdecl -ret64 _Getcoll() @ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -norelay _Getcvt() @ cdecl -norelay _Getcvt()
@ extern _Hugeval @ extern _Hugeval

View File

@ -5115,7 +5115,7 @@
@ extern _FSnan @ extern _FSnan
# extern _FXbig # extern _FXbig
# extern _FZero # extern _FZero
@ cdecl -ret64 _Getcoll() @ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -norelay _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getwctype(long ptr) @ cdecl _Getwctype(long ptr)

View File

@ -5724,7 +5724,7 @@
@ stub _FSinh @ stub _FSinh
@ extern _FSnan @ extern _FSnan
# extern _FXbig # extern _FXbig
@ cdecl -ret64 _Getcoll() @ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -norelay _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()

View File

@ -669,20 +669,23 @@ static _Collvec* getcoll(_Collvec *ret)
} }
/* _Getcoll */ /* _Getcoll */
#if defined(__i386__) || _MSVCP_VER<110 #if defined(__i386__)
/* Work around a gcc bug */
ULONGLONG __cdecl _Getcoll(void) ULONGLONG __cdecl _Getcoll(void)
{ {
C_ASSERT(sizeof(_Collvec) == sizeof(ULONGLONG));
ULONGLONG ret; ULONGLONG ret;
C_ASSERT(sizeof(_Collvec) <= sizeof(ULONGLONG));
getcoll((_Collvec*)&ret); getcoll((_Collvec*)&ret);
return ret; return ret;
} }
#else #else
_Collvec* __cdecl _Getcoll(_Collvec *ret) _Collvec __cdecl _Getcoll(void)
{ {
return getcoll(ret); _Collvec ret;
getcoll(&ret);
return ret;
} }
#endif #endif

View File

@ -6500,7 +6500,7 @@
@ stub _FSinh @ stub _FSinh
@ extern _FSnan @ extern _FSnan
# extern _FXbig # extern _FXbig
@ cdecl -ret64 _Getcoll() @ cdecl -norelay _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -norelay _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()

View File

@ -101,7 +101,7 @@ static char* (__cdecl *p_Copy_s)(char*, size_t, const char*, size_t);
static unsigned short (__cdecl *p_wctype)(const char*); static unsigned short (__cdecl *p_wctype)(const char*);
static MSVCP__Ctypevec* (__cdecl *p__Getctype)(MSVCP__Ctypevec*); static MSVCP__Ctypevec* (__cdecl *p__Getctype)(MSVCP__Ctypevec*);
static /*MSVCP__Collvec*/ULONGLONG (__cdecl *p__Getcoll)(void); static MSVCP__Collvec (__cdecl *p__Getcoll)(void);
static wctrans_t (__cdecl *p_wctrans)(const char*); static wctrans_t (__cdecl *p_wctrans)(const char*);
static wint_t (__cdecl *p_towctrans)(wint_t, wctrans_t); static wint_t (__cdecl *p_towctrans)(wint_t, wctrans_t);
static void (__cdecl *p_locale__Locimp__Locimp_Addfac)(locale__Locimp*,locale_facet*,size_t); static void (__cdecl *p_locale__Locimp__Locimp_Addfac)(locale__Locimp*,locale_facet*,size_t);
@ -604,26 +604,23 @@ static void test__Getctype(void)
static void test__Getcoll(void) static void test__Getcoll(void)
{ {
ULONGLONG (__cdecl *p__Getcoll_arg)(MSVCP__Collvec*); #ifdef __i386__
/* Workaround a gcc bug */
ULONGLONG tmp;
#define call__Getcoll(ret) tmp = ((ULONGLONG (__cdecl*)(void))p__Getcoll)(); \
memcpy(&ret, &tmp, sizeof(tmp))
#else
#define call__Getcoll(ret) ret = p__Getcoll()
#endif
_locale_t locale; _locale_t locale;
MSVCP__Collvec ret;
union {
MSVCP__Collvec collvec;
ULONGLONG ull;
}ret;
locale = p__get_current_locale(); locale = p__get_current_locale();
locale->locinfo->lc_handle[LC_COLLATE] = 0x7654321; locale->locinfo->lc_handle[LC_COLLATE] = 0x7654321;
p__free_locale(locale); p__free_locale(locale);
ret.ull = 0; call__Getcoll(ret);
p__Getcoll_arg = (void*)p__Getcoll; ok(ret.handle == 0x7654321, "ret.handle = %x\n", ret.handle);
p__Getcoll_arg(&ret.collvec); ok(ret.page == 0, "ret.page = %x\n", ret.page);
ok(ret.collvec.handle == 0, "ret.handle = %x\n", ret.collvec.handle);
ok(ret.collvec.page == 0, "ret.page = %x\n", ret.collvec.page);
ret.ull = p__Getcoll();
ok(ret.collvec.handle == 0x7654321, "ret.collvec.handle = %x\n", ret.collvec.handle);
ok(ret.collvec.page == 0, "ret.page = %x\n", ret.collvec.page);
} }
static void test_towctrans(void) static void test_towctrans(void)