Commit 24f7abaf authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp90: Depend on compiler in _Getcvt implementation if possible.

parent a0428db8
...@@ -2917,7 +2917,7 @@ ...@@ -2917,7 +2917,7 @@
@ stub _GetLocaleForCP @ stub _GetLocaleForCP
@ cdecl -ret64 _Getcoll() @ cdecl -ret64 _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -ret64 _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr) @ cdecl _Getwctype(long ptr)
@ cdecl _Getwctypes(ptr ptr ptr ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr)
......
...@@ -3780,7 +3780,7 @@ ...@@ -3780,7 +3780,7 @@
# extern _FZero # extern _FZero
@ cdecl -ret64 _Getcoll() @ cdecl -ret64 _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -ret64 _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr) @ cdecl _Getwctype(long ptr)
@ cdecl _Getwctypes(ptr ptr ptr ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr)
......
...@@ -3723,7 +3723,7 @@ ...@@ -3723,7 +3723,7 @@
# extern _FZero # extern _FZero
@ cdecl -ret64 _Getcoll() @ cdecl -ret64 _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -ret64 _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr) @ cdecl _Getwctype(long ptr)
@ cdecl _Getwctypes(ptr ptr ptr ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr)
......
...@@ -209,7 +209,7 @@ static int (__cdecl *p__ismbblead)(unsigned int); ...@@ -209,7 +209,7 @@ static int (__cdecl *p__ismbblead)(unsigned int);
static MSVCRT_long (__cdecl *p__Xtime_diff_to_millis2)(const xtime*, const xtime*); static MSVCRT_long (__cdecl *p__Xtime_diff_to_millis2)(const xtime*, const xtime*);
static int (__cdecl *p_xtime_get)(xtime*, int); static int (__cdecl *p_xtime_get)(xtime*, int);
static _Cvtvec* (__cdecl *p__Getcvt)(_Cvtvec*); static _Cvtvec (__cdecl *p__Getcvt)(void);
static void (CDECL *p__Call_once)(int *once, void (CDECL *func)(void)); static void (CDECL *p__Call_once)(int *once, void (CDECL *func)(void));
static void (CDECL *p__Call_onceEx)(int *once, void (CDECL *func)(void*), void *argv); static void (CDECL *p__Call_onceEx)(int *once, void (CDECL *func)(void*), void *argv);
static void (CDECL *p__Do_call)(void *this); static void (CDECL *p__Do_call)(void *this);
...@@ -930,7 +930,7 @@ static void test__Getcvt(void) ...@@ -930,7 +930,7 @@ static void test__Getcvt(void)
_Cvtvec cvtvec; _Cvtvec cvtvec;
int i; int i;
p__Getcvt(&cvtvec); cvtvec = p__Getcvt();
ok(cvtvec.page == 0, "cvtvec.page = %d\n", cvtvec.page); ok(cvtvec.page == 0, "cvtvec.page = %d\n", cvtvec.page);
ok(cvtvec.mb_max == 1, "cvtvec.mb_max = %d\n", cvtvec.mb_max); ok(cvtvec.mb_max == 1, "cvtvec.mb_max = %d\n", cvtvec.mb_max);
todo_wine ok(cvtvec.unk == 1, "cvtvec.unk = %d\n", cvtvec.unk); todo_wine ok(cvtvec.unk == 1, "cvtvec.unk = %d\n", cvtvec.unk);
...@@ -941,7 +941,7 @@ static void test__Getcvt(void) ...@@ -941,7 +941,7 @@ static void test__Getcvt(void)
win_skip("_Getcvt tests\n"); win_skip("_Getcvt tests\n");
return; return;
} }
p__Getcvt(&cvtvec); cvtvec = p__Getcvt();
ok(cvtvec.page == 936, "cvtvec.page = %d\n", cvtvec.page); ok(cvtvec.page == 936, "cvtvec.page = %d\n", cvtvec.page);
ok(cvtvec.mb_max == 2, "cvtvec.mb_max = %d\n", cvtvec.mb_max); ok(cvtvec.mb_max == 2, "cvtvec.mb_max = %d\n", cvtvec.mb_max);
ok(cvtvec.unk == 0, "cvtvec.unk = %d\n", cvtvec.unk); ok(cvtvec.unk == 0, "cvtvec.unk = %d\n", cvtvec.unk);
...@@ -955,7 +955,7 @@ static void test__Getcvt(void) ...@@ -955,7 +955,7 @@ static void test__Getcvt(void)
} }
p__setmbcp(936); p__setmbcp(936);
p__Getcvt(&cvtvec); cvtvec = p__Getcvt();
ok(cvtvec.page == 936, "cvtvec.page = %d\n", cvtvec.page); ok(cvtvec.page == 936, "cvtvec.page = %d\n", cvtvec.page);
ok(cvtvec.mb_max == 2, "cvtvec.mb_max = %d\n", cvtvec.mb_max); ok(cvtvec.mb_max == 2, "cvtvec.mb_max = %d\n", cvtvec.mb_max);
ok(cvtvec.unk == 0, "cvtvec.unk = %d\n", cvtvec.unk); ok(cvtvec.unk == 0, "cvtvec.unk = %d\n", cvtvec.unk);
......
...@@ -3723,7 +3723,7 @@ ...@@ -3723,7 +3723,7 @@
# extern _FZero # extern _FZero
@ cdecl -ret64 _Getcoll() msvcp120._Getcoll @ cdecl -ret64 _Getcoll() msvcp120._Getcoll
@ cdecl _Getctype(ptr) msvcp120._Getctype @ cdecl _Getctype(ptr) msvcp120._Getctype
@ cdecl -ret64 _Getcvt() msvcp120._Getcvt @ cdecl -norelay _Getcvt() msvcp120._Getcvt
@ cdecl _Getdateorder() msvcp120._Getdateorder @ cdecl _Getdateorder() msvcp120._Getdateorder
@ cdecl _Getwctype(long ptr) msvcp120._Getwctype @ cdecl _Getwctype(long ptr) msvcp120._Getwctype
@ cdecl _Getwctypes(ptr ptr ptr ptr) msvcp120._Getwctypes @ cdecl _Getwctypes(ptr ptr ptr ptr) msvcp120._Getwctypes
......
...@@ -3651,7 +3651,7 @@ ...@@ -3651,7 +3651,7 @@
@ cdecl _File_size(wstr) @ cdecl _File_size(wstr)
@ cdecl -ret64 _Getcoll() @ cdecl -ret64 _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -ret64 _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr) @ cdecl _Getwctype(long ptr)
@ cdecl _Getwctypes(ptr ptr ptr ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr)
......
...@@ -4276,7 +4276,7 @@ ...@@ -4276,7 +4276,7 @@
# extern _FXbig # extern _FXbig
@ cdecl -ret64 _Getcoll() @ cdecl -ret64 _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -ret64 _Getcvt() @ cdecl -norelay _Getcvt()
@ extern _Hugeval _Hugeval @ extern _Hugeval _Hugeval
@ extern _Inf _Inf @ extern _Inf _Inf
@ stub _LCosh @ stub _LCosh
......
...@@ -5063,7 +5063,7 @@ ...@@ -5063,7 +5063,7 @@
# extern _FZero # extern _FZero
@ cdecl -ret64 _Getcoll() @ cdecl -ret64 _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -ret64 _Getcvt() @ cdecl -norelay _Getcvt()
@ extern _Hugeval @ extern _Hugeval
@ extern _Inf @ extern _Inf
@ stub _LCosh @ stub _LCosh
......
...@@ -5117,7 +5117,7 @@ ...@@ -5117,7 +5117,7 @@
# extern _FZero # extern _FZero
@ cdecl -ret64 _Getcoll() @ cdecl -ret64 _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -ret64 _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getwctype(long ptr) @ cdecl _Getwctype(long ptr)
@ cdecl _Getwctypes(ptr ptr ptr ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr)
@ extern _Hugeval @ extern _Hugeval
......
...@@ -5726,7 +5726,7 @@ ...@@ -5726,7 +5726,7 @@
# extern _FXbig # extern _FXbig
@ cdecl -ret64 _Getcoll() @ cdecl -ret64 _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -ret64 _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr) @ cdecl _Getwctype(long ptr)
@ cdecl _Getwctypes(ptr ptr ptr ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr)
......
...@@ -735,9 +735,11 @@ _Ctypevec* __thiscall _Locinfo__Getctype(const _Locinfo *this, _Ctypevec *ret) ...@@ -735,9 +735,11 @@ _Ctypevec* __thiscall _Locinfo__Getctype(const _Locinfo *this, _Ctypevec *ret)
} }
/* _Getcvt */ /* _Getcvt */
#if _MSVCP_VER < 110 #if _MSVCP_VER < 110 && defined(__i386__)
/* Work around a gcc bug */
ULONGLONG __cdecl _Getcvt(void) ULONGLONG __cdecl _Getcvt(void)
{ {
C_ASSERT(sizeof(_Cvtvec) == sizeof(ULONGLONG));
union { union {
_Cvtvec cvtvec; _Cvtvec cvtvec;
ULONGLONG ull; ULONGLONG ull;
...@@ -749,20 +751,32 @@ ULONGLONG __cdecl _Getcvt(void) ...@@ -749,20 +751,32 @@ ULONGLONG __cdecl _Getcvt(void)
ret.cvtvec.handle = ___lc_handle_func()[LC_CTYPE]; ret.cvtvec.handle = ___lc_handle_func()[LC_CTYPE];
return ret.ull; return ret.ull;
} }
#elif _MSVCP_VER < 110
_Cvtvec __cdecl _Getcvt(void)
{
_Cvtvec ret;
TRACE("\n");
ret.page = ___lc_codepage_func();
ret.handle = ___lc_handle_func()[LC_CTYPE];
return ret;
}
#else #else
_Cvtvec* __cdecl _Getcvt(_Cvtvec *ret) _Cvtvec __cdecl _Getcvt(void)
{ {
_Cvtvec ret;
int i; int i;
TRACE("\n"); TRACE("\n");
memset(ret, 0, sizeof(*ret)); memset(&ret, 0, sizeof(ret));
ret->page = ___lc_codepage_func(); ret.page = ___lc_codepage_func();
ret->mb_max = ___mb_cur_max_func(); ret.mb_max = ___mb_cur_max_func();
if(ret->mb_max > 1) { if(ret.mb_max > 1) {
for(i=0; i<256; i++) for(i=0; i<256; i++)
if(_ismbblead(i)) ret->isleadbyte[i/8] |= 1 << (i&7); if(_ismbblead(i)) ret.isleadbyte[i/8] |= 1 << (i&7);
} }
return ret; return ret;
} }
...@@ -773,14 +787,14 @@ _Cvtvec* __cdecl _Getcvt(_Cvtvec *ret) ...@@ -773,14 +787,14 @@ _Cvtvec* __cdecl _Getcvt(_Cvtvec *ret)
DEFINE_THISCALL_WRAPPER(_Locinfo__Getcvt, 8) DEFINE_THISCALL_WRAPPER(_Locinfo__Getcvt, 8)
_Cvtvec* __thiscall _Locinfo__Getcvt(const _Locinfo *this, _Cvtvec *ret) _Cvtvec* __thiscall _Locinfo__Getcvt(const _Locinfo *this, _Cvtvec *ret)
{ {
#if _MSVCP_VER < 110 #if _MSVCP_VER < 110 && defined(__i386__)
ULONGLONG ull = _Getcvt(); ULONGLONG cvtvec;
memcpy(ret, &ull, sizeof(ull));
#else #else
_Cvtvec cvtvec; _Cvtvec cvtvec;
_Getcvt(&cvtvec);
memcpy(ret, &cvtvec, sizeof(cvtvec));
#endif #endif
cvtvec = _Getcvt();
memcpy(ret, &cvtvec, sizeof(cvtvec));
return ret; return ret;
} }
......
...@@ -6502,7 +6502,7 @@ ...@@ -6502,7 +6502,7 @@
# extern _FXbig # extern _FXbig
@ cdecl -ret64 _Getcoll() @ cdecl -ret64 _Getcoll()
@ cdecl _Getctype(ptr) @ cdecl _Getctype(ptr)
@ cdecl -ret64 _Getcvt() @ cdecl -norelay _Getcvt()
@ cdecl _Getdateorder() @ cdecl _Getdateorder()
@ cdecl _Getwctype(long ptr) @ cdecl _Getwctype(long ptr)
@ cdecl _Getwctypes(ptr ptr ptr ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr)
......
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