X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f4a0c5be34be837210768501c13dbcff81e533c..f11f454d85f2eaabd5e2cfbba02b4cfc0b3e7088:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 1107cc55cf..10f765aff9 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -63,7 +63,7 @@ // --------------------------------------------------------------------------- #ifdef wxSTD_STRING_COMPATIBILITY - const size_t wxString::npos = STRING_MAXLEN; + const size_t wxString::npos = wxSTRING_MAXLEN; #endif // wxSTD_STRING_COMPATIBILITY // ---------------------------------------------------------------------------- @@ -104,9 +104,19 @@ extern const char WXDLLEXPORT *g_szNul = &g_strEmpty.dummy; // always available), but it's unsafe because it doesn't check for buffer // size - so give a warning #define wxVsprintf(buffer,len,format,argptr) vsprintf(buffer,format, argptr) -#ifndef __SC__ +#if defined(__VISUALC__) #pragma message("Using sprintf() because no snprintf()-like function defined") -#endif +#elif defined(__GNUG__) + #warning "Using sprintf() because no snprintf()-like function defined" +#elif defined(__MWERKS__) + #warning "Using sprintf() because no snprintf()-like function defined" +#elif defined(__SUNCC__) + // nothing -- I don't know about "#warning" for Sun's CC +#else + // change this to some analogue of '#warning' for your compiler + #error "Using sprintf() because no snprintf()-like function defined" +#endif //compiler + #endif // no vsnprintf // ---------------------------------------------------------------------------- @@ -211,7 +221,7 @@ void wxString::InitWith(const char *psz, size_t nPos, size_t nLength) wxASSERT( nPos <= Strlen(psz) ); - if ( nLength == STRING_MAXLEN ) + if ( nLength == wxSTRING_MAXLEN ) nLength = Strlen(psz + nPos); STATISTICS_ADD(InitialLength, nLength); @@ -611,8 +621,8 @@ wxString wxString::Mid(size_t nFirst, size_t nCount) const wxStringData *pData = GetStringData(); size_t nLen = pData->nDataLength; - // default value of nCount is STRING_MAXLEN and means "till the end" - if ( nCount == STRING_MAXLEN ) + // default value of nCount is wxSTRING_MAXLEN and means "till the end" + if ( nCount == wxSTRING_MAXLEN ) { nCount = nLen - nFirst; }