Commit ef9a3be8 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp110: Fix 64-bit _Getcoll implementation.

parent 413ad29e
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <stdarg.h> #include <stdarg.h>
#include "assert.h"
#include "locale.h" #include "locale.h"
#include "errno.h" #include "errno.h"
#include "limits.h" #include "limits.h"
...@@ -649,33 +650,43 @@ _Locinfo* __thiscall _Locinfo__Addcats(_Locinfo *this, int category, const char ...@@ -649,33 +650,43 @@ _Locinfo* __thiscall _Locinfo__Addcats(_Locinfo *this, int category, const char
return _Locinfo__Locinfo_Addcats(this, category, locstr); return _Locinfo__Locinfo_Addcats(this, category, locstr);
} }
/* _Getcoll */ static _Collvec* getcoll(_Collvec *ret)
ULONGLONG __cdecl _Getcoll(void)
{ {
union {
_Collvec collvec;
ULONGLONG ull;
} ret;
TRACE("\n"); TRACE("\n");
ret.collvec.page = ___lc_collate_cp_func(); ret->page = ___lc_collate_cp_func();
#if _MSVCP_VER < 110 #if _MSVCP_VER < 110
ret.collvec.handle = ___lc_handle_func()[LC_COLLATE]; ret->handle = ___lc_handle_func()[LC_COLLATE];
#else #else
ret.collvec.lc_name = ___lc_locale_name_func()[LC_COLLATE]; ret->lc_name = ___lc_locale_name_func()[LC_COLLATE];
#endif #endif
return ret.ull; return ret;
} }
/* _Getcoll */
#if defined(__i386__) || _MSVCP_VER<110
ULONGLONG __cdecl _Getcoll(void)
{
ULONGLONG ret;
C_ASSERT(sizeof(_Collvec) <= sizeof(ULONGLONG));
getcoll((_Collvec*)&ret);
return ret;
}
#else
_Collvec* __cdecl _Getcoll(_Collvec *ret)
{
return getcoll(ret);
}
#endif
/* ?_Getcoll@_Locinfo@std@@QBE?AU_Collvec@@XZ */ /* ?_Getcoll@_Locinfo@std@@QBE?AU_Collvec@@XZ */
/* ?_Getcoll@_Locinfo@std@@QEBA?AU_Collvec@@XZ */ /* ?_Getcoll@_Locinfo@std@@QEBA?AU_Collvec@@XZ */
DEFINE_THISCALL_WRAPPER(_Locinfo__Getcoll, 8) DEFINE_THISCALL_WRAPPER(_Locinfo__Getcoll, 8)
_Collvec* __thiscall _Locinfo__Getcoll(const _Locinfo *this, _Collvec *ret) _Collvec* __thiscall _Locinfo__Getcoll(const _Locinfo *this, _Collvec *ret)
{ {
ULONGLONG ull = _Getcoll(); return getcoll(ret);
memcpy(ret, &ull, sizeof(ull));
return ret;
} }
/* _Getctype */ /* _Getctype */
......
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