Piotr Caban : msvcp90: Added locale::global implementation.

Alexandre Julliard julliard at winehq.org
Tue Jun 12 13:36:33 CDT 2012


Module: wine
Branch: master
Commit: 65db238da0bd62bd830d4867abef6c921f3e04f2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=65db238da0bd62bd830d4867abef6c921f3e04f2

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Jun 12 18:12:51 2012 +0200

msvcp90: Added locale::global implementation.

---

 dlls/msvcp90/locale.c     |   27 +++++++++++++++++++++++++++
 dlls/msvcp90/msvcp90.spec |    4 ++--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index f5fec45..ca8001b 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -4614,6 +4614,33 @@ basic_string_char* __thiscall locale_name(const locale *this, basic_string_char
     return ret;
 }
 
+/* ?global at locale@std@@SA?AV12 at ABV12@@Z */
+/* ?global at locale@std@@SA?AV12 at AEBV12@@Z */
+locale* __cdecl locale_global(locale *ret, const locale *loc)
+{
+    _Lockit lock;
+    int i;
+
+    TRACE("(%p %p)\n", loc, ret);
+
+    _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
+    locale_ctor(ret);
+
+    if(loc->ptr != global_locale) {
+        locale_facet__Decref(&global_locale->facet);
+        global_locale = loc->ptr;
+        locale_facet__Incref(&global_locale->facet);
+
+        for(i=LC_ALL+1; i<=LC_MAX; i++) {
+            if((global_locale->catmask & (1<<(i-1))) == 0)
+                continue;
+            setlocale(i, MSVCP_basic_string_char_c_str(&global_locale->name));
+        }
+    }
+    _Lockit_dtor(&lock);
+    return ret;
+}
+
 DEFINE_RTTI_DATA(locale_facet, 0, 0, NULL, NULL, NULL, ".?AVfacet at locale@std@@");
 DEFINE_RTTI_DATA(collate_char, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AV?$collate at D@std@@");
 DEFINE_RTTI_DATA(collate_wchar, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AV?$collate at _W@std@@");
diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec
index 880e84d..a823f3f 100644
--- a/dlls/msvcp90/msvcp90.spec
+++ b/dlls/msvcp90/msvcp90.spec
@@ -4155,8 +4155,8 @@
 @ cdecl -arch=win64 ?getloc@?$basic_streambuf at _WU?$char_traits at _W@std@@@std@@QEBA?AVlocale at 2@XZ(ptr ptr) basic_streambuf_wchar_getloc
 @ thiscall -arch=win32 ?getloc at ios_base@std@@QBE?AVlocale at 2@XZ(ptr ptr) ios_base_getloc
 @ cdecl -arch=win64 ?getloc at ios_base@std@@QEBA?AVlocale at 2@XZ(ptr ptr) ios_base_getloc
-@ stub -arch=win32 ?global at locale@std@@SA?AV12 at ABV12@@Z
-@ stub -arch=win64 ?global at locale@std@@SA?AV12 at AEBV12@@Z
+@ cdecl -arch=win32 ?global at locale@std@@SA?AV12 at ABV12@@Z(ptr ptr) locale_global
+@ cdecl -arch=win64 ?global at locale@std@@SA?AV12 at AEBV12@@Z(ptr ptr) locale_global
 @ thiscall -arch=win32 ?good at ios_base@std@@QBE_NXZ(ptr) ios_base_good
 @ cdecl -arch=win64 ?good at ios_base@std@@QEBA_NXZ(ptr) ios_base_good
 @ thiscall -arch=win32 ?gptr@?$basic_streambuf at DU?$char_traits at D@std@@@std@@IBEPADXZ(ptr) basic_streambuf_char_gptr




More information about the wine-cvs mailing list