From 9c521e0003c85a0e87b93b0179b3ae1de153bb01 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 28 Jul 2008 16:58:25 +0000 Subject: [PATCH] build fix for wxMac with wxUSE_THREADS==0 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@54797 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/strconv.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index f74dfee11a..0739b672fd 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -2803,7 +2803,9 @@ public: ubuf = (UniChar*) (buf ? buf : tbuf) ; #endif { +#if wxUSE_THREADS wxMutexLocker lock( m_MB2WC_guard ); +#endif status = TECConvertText( m_MB2WC_converter, (ConstTextPtr) psz, byteInLen, &byteInLen, (TextPtr) ubuf, byteBufferLen, &byteOutLen); @@ -2859,7 +2861,9 @@ public: #endif { +#if wxUSE_THREADS wxMutexLocker lock( m_WC2MB_guard ); +#endif status = TECConvertText( m_WC2MB_converter, (ConstTextPtr) ubuf, byteInLen, &byteInLen, (TextPtr) (buf ? buf : tbuf), byteBufferLen, &byteOutLen); @@ -2905,9 +2909,10 @@ public: protected : mutable TECObjectRef m_MB2WC_converter; mutable TECObjectRef m_WC2MB_converter; - +#if wxUSE_THREADS mutable wxMutex m_MB2WC_guard; mutable wxMutex m_WC2MB_guard; +#endif TextEncodingBase m_char_encoding; TextEncodingBase m_unicode_encoding; @@ -2969,7 +2974,9 @@ public : UniChar *dcubuf = (UniChar*) malloc( dcubuflen ) ; { +#if wxUSE_THREADS wxMutexLocker lock( m_WC2MB_guard ); +#endif ConvertFromUnicodeToText( m_uni , byteInLen , ubuf , kUnicodeDefaultDirectionMask, 0, NULL, NULL, NULL, dcubuflen , &dcubufread , &dcubufwritten , dcubuf ) ; @@ -3029,7 +3036,9 @@ public : UniChar *dcubuf = (UniChar*) malloc( dcubuflen ) ; { +#if wxUSE_THREADS wxMutexLocker lock( m_MB2WC_guard ); +#endif status = TECConvertText( m_MB2WC_converter, (ConstTextPtr) psz, byteInLen, &byteInLen, (TextPtr) dcubuf, dcubuflen, &byteOutLen);