mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 11:57:17 +00:00
msvcp110: Fix _Getcvt implementation.
This commit is contained in:
parent
bdf8c7a148
commit
d7f6eac058
|
@ -3780,7 +3780,7 @@
|
||||||
# extern _FZero
|
# extern _FZero
|
||||||
@ cdecl -ret64 _Getcoll()
|
@ cdecl -ret64 _Getcoll()
|
||||||
@ cdecl _Getctype(ptr)
|
@ cdecl _Getctype(ptr)
|
||||||
@ cdecl -ret64 _Getcvt()
|
@ cdecl _Getcvt(ptr)
|
||||||
@ 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 @@
|
||||||
# extern _FZero
|
# extern _FZero
|
||||||
@ cdecl -ret64 _Getcoll()
|
@ cdecl -ret64 _Getcoll()
|
||||||
@ cdecl _Getctype(ptr)
|
@ cdecl _Getctype(ptr)
|
||||||
@ cdecl -ret64 _Getcvt()
|
@ cdecl _Getcvt(ptr)
|
||||||
@ 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 @@
|
||||||
# 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 _Getcvt(ptr) 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
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "errno.h"
|
#include "errno.h"
|
||||||
#include "limits.h"
|
#include "limits.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
|
#include "mbctype.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "wchar.h"
|
#include "wchar.h"
|
||||||
#include "wctype.h"
|
#include "wctype.h"
|
||||||
|
@ -684,6 +685,7 @@ _Ctypevec* __thiscall _Locinfo__Getctype(const _Locinfo *this, _Ctypevec *ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* _Getcvt */
|
/* _Getcvt */
|
||||||
|
#if _MSVCP_VER < 110
|
||||||
ULONGLONG __cdecl _Getcvt(void)
|
ULONGLONG __cdecl _Getcvt(void)
|
||||||
{
|
{
|
||||||
union {
|
union {
|
||||||
|
@ -697,14 +699,38 @@ 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;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
_Cvtvec* __cdecl _Getcvt(_Cvtvec *ret)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
TRACE("\n");
|
||||||
|
|
||||||
|
memset(ret, 0, sizeof(*ret));
|
||||||
|
ret->page = ___lc_codepage_func();
|
||||||
|
ret->mb_max = ___mb_cur_max_func();
|
||||||
|
|
||||||
|
if(ret->mb_max > 1) {
|
||||||
|
for(i=0; i<256; i++)
|
||||||
|
if(_ismbblead(i)) ret->isleadbyte[i/8] |= 1 << (i&7);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ?_Getcvt@_Locinfo@std@@QBE?AU_Cvtvec@@XZ */
|
/* ?_Getcvt@_Locinfo@std@@QBE?AU_Cvtvec@@XZ */
|
||||||
/* ?_Getcvt@_Locinfo@std@@QEBA?AU_Cvtvec@@XZ */
|
/* ?_Getcvt@_Locinfo@std@@QEBA?AU_Cvtvec@@XZ */
|
||||||
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
|
||||||
ULONGLONG ull = _Getcvt();
|
ULONGLONG ull = _Getcvt();
|
||||||
memcpy(ret, &ull, sizeof(ull));
|
memcpy(ret, &ull, sizeof(ull));
|
||||||
|
#else
|
||||||
|
_Cvtvec cvtvec;
|
||||||
|
_Getcvt(&cvtvec);
|
||||||
|
memcpy(ret, &cvtvec, sizeof(cvtvec));
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -192,8 +192,15 @@ int __thiscall codecvt_char_in(const codecvt_char*, int*, const char*,
|
||||||
int __thiscall codecvt_base_max_length(const codecvt_base*);
|
int __thiscall codecvt_base_max_length(const codecvt_base*);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
#if _MSVCP_VER < 110
|
||||||
LCID handle;
|
LCID handle;
|
||||||
|
#endif
|
||||||
unsigned page;
|
unsigned page;
|
||||||
|
#if _MSVCP_VER >= 110
|
||||||
|
int mb_max;
|
||||||
|
int unk;
|
||||||
|
BYTE isleadbyte[32];
|
||||||
|
#endif
|
||||||
} _Cvtvec;
|
} _Cvtvec;
|
||||||
|
|
||||||
/* class codecvt<wchar> */
|
/* class codecvt<wchar> */
|
||||||
|
|
|
@ -119,8 +119,8 @@ extern unsigned int _fmode;
|
||||||
|
|
||||||
#endif /* __i386__ */
|
#endif /* __i386__ */
|
||||||
|
|
||||||
extern int* __cdecl ___mb_cur_max_func(void);
|
extern int __cdecl ___mb_cur_max_func(void);
|
||||||
#define __mb_cur_max (*___mb_cur_max_func())
|
#define __mb_cur_max ___mb_cur_max_func()
|
||||||
extern __msvcrt_ulong* __cdecl __doserrno(void);
|
extern __msvcrt_ulong* __cdecl __doserrno(void);
|
||||||
#define _doserrno (*__doserrno())
|
#define _doserrno (*__doserrno())
|
||||||
extern int* __cdecl _errno(void);
|
extern int* __cdecl _errno(void);
|
||||||
|
|
Loading…
Reference in a new issue