Module: wine Branch: master Commit: e9b51093deeca572e93906c45fc08f6fefefc728 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e9b51093deeca572e93906c45f...
Author: Piotr Caban piotr@codeweavers.com Date: Thu Sep 6 11:42:05 2012 +0200
msvcp90: Added locale_ctor_locale_locale implementation.
---
dlls/msvcp100/locale.c | 19 +++++++++++++++++-- dlls/msvcp90/locale.c | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcp100/locale.c b/dlls/msvcp100/locale.c index 1bba834..55b3134 100644 --- a/dlls/msvcp100/locale.c +++ b/dlls/msvcp100/locale.c @@ -8104,8 +8104,23 @@ locale__Locimp* __cdecl locale__Init(void) DEFINE_THISCALL_WRAPPER(locale_ctor_locale_locale, 16) locale* __thiscall locale_ctor_locale_locale(locale *this, const locale *loc, const locale *other, category cat) { - FIXME("(%p %p %p %d) stub\n", this, loc, other, cat); - return NULL; + _Locinfo locinfo; + + TRACE("(%p %p %p %d)\n", this, loc, other, cat); + + this->ptr = MSVCRT_operator_new(sizeof(locale__Locimp)); + if(!this->ptr) { + ERR("Out of memory\n"); + throw_exception(EXCEPTION_BAD_ALLOC, NULL); + } + locale__Locimp_copy_ctor(this->ptr, loc->ptr); + + _Locinfo_ctor_cat_cstr(&locinfo, loc->ptr->catmask, MSVCP_basic_string_char_c_str(&loc->ptr->name)); + _Locinfo__Addcats(&locinfo, cat & other->ptr->catmask, MSVCP_basic_string_char_c_str(&other->ptr->name)); + locale__Locimp__Makeloc(&locinfo, cat, this->ptr, other); + _Locinfo_dtor(&locinfo); + + return this; }
/* ??0locale@std@@QAE@ABV01@@Z */ diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 1d9eb33..f5a4534 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -8255,8 +8255,23 @@ locale__Locimp* __cdecl locale__Init(void) DEFINE_THISCALL_WRAPPER(locale_ctor_locale_locale, 16) locale* __thiscall locale_ctor_locale_locale(locale *this, const locale *loc, const locale *other, category cat) { - FIXME("(%p %p %p %d) stub\n", this, loc, other, cat); - return NULL; + _Locinfo locinfo; + + TRACE("(%p %p %p %d)\n", this, loc, other, cat); + + this->ptr = MSVCRT_operator_new(sizeof(locale__Locimp)); + if(!this->ptr) { + ERR("Out of memory\n"); + throw_exception(EXCEPTION_BAD_ALLOC, NULL); + } + locale__Locimp_copy_ctor(this->ptr, loc->ptr); + + _Locinfo_ctor_cat_cstr(&locinfo, loc->ptr->catmask, MSVCP_basic_string_char_c_str(&loc->ptr->name)); + _Locinfo__Addcats(&locinfo, cat & other->ptr->catmask, MSVCP_basic_string_char_c_str(&other->ptr->name)); + locale__Locimp__Makeloc(&locinfo, cat, this->ptr, other); + _Locinfo_dtor(&locinfo); + + return this; }
/* ??0locale@std@@QAE@ABV01@@Z */