[35613] trunk/dports/graphics/wxWidgets

afb at macports.org afb at macports.org
Mon Mar 31 03:22:48 PDT 2008


Revision: 35613
          http://trac.macosforge.org/projects/macports/changeset/35613
Author:   afb at macports.org
Date:     2008-03-31 03:22:44 -0700 (Mon, 31 Mar 2008)

Log Message:
-----------
fix crashing wxMac threading bug (#14720, maintainer timeout)

Modified Paths:
--------------
    trunk/dports/graphics/wxWidgets/Portfile

Added Paths:
-----------
    trunk/dports/graphics/wxWidgets/files/patch-TECConvertText.diff

Modified: trunk/dports/graphics/wxWidgets/Portfile
===================================================================
--- trunk/dports/graphics/wxWidgets/Portfile	2008-03-31 07:44:00 UTC (rev 35612)
+++ trunk/dports/graphics/wxWidgets/Portfile	2008-03-31 10:22:44 UTC (rev 35613)
@@ -4,6 +4,7 @@
 
 name			wxWidgets
 version			2.8.7
+revision		1
 categories		graphics devel
 platforms		darwin
 maintainers		mww jwa
@@ -44,7 +45,7 @@
 
 extract.only	${distname}-${version}${extract.suffix}
 
-patchfiles	patch-chkconf.diff
+patchfiles	patch-chkconf.diff patch-TECConvertText.diff
 
 #configure.cmd	../${distname}-${version}/configure
 configure.cmd		../configure

Added: trunk/dports/graphics/wxWidgets/files/patch-TECConvertText.diff
===================================================================
--- trunk/dports/graphics/wxWidgets/files/patch-TECConvertText.diff	                        (rev 0)
+++ trunk/dports/graphics/wxWidgets/files/patch-TECConvertText.diff	2008-03-31 10:22:44 UTC (rev 35613)
@@ -0,0 +1,94 @@
+# [ 1901956 ] wxMac: TECConvertText not thread safe
+# https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1901956&group_id=9863
+--- ../src/common.2.8.7/encconv.cpp	2007-11-21 07:41:57.000000000 -0500
++++ ../src/common/encconv.cpp	2008-02-27 01:41:43.000000000 -0500
+@@ -50,6 +50,17 @@
+     #include "wx/msw/wince/missing.h"       // for bsearch()
+ #endif
+ 
++#if defined(__WXMAC__) && defined(TARGET_CARBON)
++extern OSStatus __wxTECConvertText(
++                     TECObjectRef encodingConverter,
++                     ConstTextPtr inputBuffer,
++                     ByteCount inputBufferLength,
++                     ByteCount *actualInputLength,
++                     TextPtr outputBuffer,
++                     ByteCount outputBufferLength,
++                     ByteCount *actualOutputLength);
++#endif
++
+ static const wxUint16* GetEncTable(wxFontEncoding enc)
+ {
+ #ifdef __WXMAC__
+@@ -68,7 +79,7 @@
+             for( unsigned char c = 255 ; c >= 128 ; --c )
+             {
+                 s[0] = c ;
+-                status = TECConvertText(converter, (ConstTextPtr) &s , 1, &byteInLen,
++                status = __wxTECConvertText(converter, (ConstTextPtr) &s , 1, &byteInLen,
+                 (TextPtr) &gMacEncodings[i][c-128] , 2, &byteOutLen);
+             }
+             status = TECDisposeConverter(converter);
+--- ../src/common.2.8.7/strconv.cpp	2007-11-21 07:41:57.000000000 -0500
++++ ../src/common/strconv.cpp	2008-02-27 01:41:19.000000000 -0500
+@@ -77,6 +77,24 @@
+     #define WC_UTF16
+ #endif
+ 
++#if defined(__WXMAC__) && defined(TARGET_CARBON)
++OSStatus __wxTECConvertText(
++                     TECObjectRef encodingConverter,
++                     ConstTextPtr inputBuffer,
++                     ByteCount inputBufferLength,
++                     ByteCount *actualInputLength,
++                     TextPtr outputBuffer,
++                     ByteCount outputBufferLength,
++                     ByteCount *actualOutputLength)
++{
++	static wxCriticalSection s_sec;
++	{
++		wxCriticalSectionLocker l(s_sec);
++		return TECConvertText(encodingConverter, inputBuffer, inputBufferLength, actualInputLength, outputBuffer, outputBufferLength, actualOutputLength);
++	}
++}
++
++#endif
+ 
+ // ============================================================================
+ // implementation
+@@ -2801,7 +2819,7 @@
+         ubuf = (UniChar*) (buf ? buf : tbuf) ;
+ #endif
+ 
+-        status = TECConvertText(
++        status = __wxTECConvertText(
+             m_MB2WC_converter, (ConstTextPtr) psz, byteInLen, &byteInLen,
+             (TextPtr) ubuf, byteBufferLen, &byteOutLen);
+ 
+@@ -2854,7 +2872,7 @@
+         ubuf = (UniChar*) psz ;
+ #endif
+ 
+-        status = TECConvertText(
++        status = __wxTECConvertText(
+             m_WC2MB_converter, (ConstTextPtr) ubuf, byteInLen, &byteInLen,
+             (TextPtr) (buf ? buf : tbuf), byteBufferLen, &byteOutLen);
+ 
+@@ -2963,7 +2981,7 @@
+ 
+         // we now convert that decomposed buffer into UTF8
+ 
+-        status = TECConvertText(
++        status = __wxTECConvertText(
+             m_WC2MB_converter, (ConstTextPtr) dcubuf, dcubufwritten, &dcubufread,
+             (TextPtr) (buf ? buf : tbuf), byteBufferLen, &byteOutLen);
+ 
+@@ -3015,7 +3033,7 @@
+         ByteCount dcubufread , dcubufwritten ;
+         UniChar *dcubuf = (UniChar*) malloc( dcubuflen ) ;
+ 
+-        status = TECConvertText(
++        status = __wxTECConvertText(
+                                 m_MB2WC_converter, (ConstTextPtr) psz, byteInLen, &byteInLen,
+                                 (TextPtr) dcubuf, dcubuflen, &byteOutLen);
+         // we have to terminate here, because n might be larger for the trailing zero, and if UniChar

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080331/0de03b2d/attachment.html


More information about the macports-changes mailing list