Alexandre Julliard : msvcrt: Get rid of the LOCK_LOCALE macros.

Alexandre Julliard julliard at winehq.org
Thu Jun 16 10:20:57 CDT 2016


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jun 16 23:44:41 2016 +0900

msvcrt: Get rid of the LOCK_LOCALE macros.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/locale.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 74da555..024ec99 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -49,10 +49,6 @@ LCID MSVCRT___lc_handle[MSVCRT_LC_MAX - MSVCRT_LC_MIN + 1] = { 0 };
 int MSVCRT___mb_cur_max = 1;
 static unsigned char charmax = CHAR_MAX;
 
-/* MT */
-#define LOCK_LOCALE   _mlock(_SETLOCALE_LOCK);
-#define UNLOCK_LOCALE _munlock(_SETLOCALE_LOCK);
-
 #define MSVCRT_LEADBYTE  0x8000
 #define MSVCRT_C1_DEFINED 0x200
 
@@ -1596,7 +1592,7 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
  */
 void CDECL _lock_locales(void)
 {
-    LOCK_LOCALE
+    _mlock(_SETLOCALE_LOCK);
 }
 
 /*********************************************************************
@@ -1604,7 +1600,7 @@ void CDECL _lock_locales(void)
  */
 void CDECL _unlock_locales(void)
 {
-    UNLOCK_LOCALE
+    _munlock(_SETLOCALE_LOCK);
 }
 
 /*********************************************************************
@@ -1661,7 +1657,7 @@ char* CDECL MSVCRT_setlocale(int category, const char* locale)
         return NULL;
     }
 
-    LOCK_LOCALE;
+    _lock_locales();
 
     if(locinfo->lc_handle[MSVCRT_LC_COLLATE]!=newlocinfo->lc_handle[MSVCRT_LC_COLLATE]
             || locinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage) {
@@ -1816,7 +1812,7 @@ char* CDECL MSVCRT_setlocale(int category, const char* locale)
     }
 
     free_locinfo(newlocinfo);
-    UNLOCK_LOCALE;
+    _unlock_locales();
 
     if(locinfo == MSVCRT_locale->locinfo) {
         int i;
@@ -1858,14 +1854,14 @@ MSVCRT_wchar_t* CDECL MSVCRT__wsetlocale(int category, const MSVCRT_wchar_t* wlo
         MSVCRT_wcstombs(locale, wlocale, len);
     }
 
-    LOCK_LOCALE;
+    _lock_locales();
     ret = MSVCRT_setlocale(category, locale);
     MSVCRT_free(locale);
 
     if(ret && MSVCRT_mbstowcs(current_lc_all, ret, MAX_LOCALE_LENGTH)==-1)
         ret = NULL;
 
-    UNLOCK_LOCALE;
+    _unlock_locales();
     return ret ? current_lc_all : NULL;
 }
 
@@ -1921,9 +1917,9 @@ BOOL msvcrt_init_locale(void)
 {
     int i;
 
-    LOCK_LOCALE;
+    _lock_locales();
     MSVCRT_locale = MSVCRT__create_locale(0, "C");
-    UNLOCK_LOCALE;
+    _unlock_locales();
     if(!MSVCRT_locale)
         return FALSE;
 




More information about the wine-cvs mailing list