]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
use AlphaBlt() when blitting to a bitmap with alpha channel too (patch 991166)
[wxWidgets.git] / src / common / string.cpp
index 8d3c198b8d8fe8c428639ae2c040b1c351264239..07a532d180981cd76eaeb9ab9faec418f5ba00ad 100644 (file)
@@ -1223,6 +1223,12 @@ wxString operator+(const wxChar *psz, const wxString& str)
 
 #if wxUSE_UNICODE
 
+#ifdef __MWERKS__
+#ifndef __SCHAR_MAX__
+#define __SCHAR_MAX__ 127
+#endif
+#endif
+
 wxString wxString::FromAscii(const char *ascii)
 {
     if (!ascii)
@@ -1721,7 +1727,12 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
                 return -1;
             }
 
-            len = wxVsnprintf(buf, size, pszFormat, argptr);
+            // wxVsnprintf() may modify the original arg pointer, so pass it
+            // only a copy
+            va_list argptrcopy;
+            wxVaCopy(argptrcopy, argptr);
+            len = wxVsnprintf(buf, size, pszFormat, argptrcopy);
+            va_end(argptrcopy);
 
             // some implementations of vsnprintf() don't NUL terminate
             // the string if there is not enough space for it so