vswprintf() compilation fix for mingw32 with STLport 5.1
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -371,6 +371,14 @@
|
||||
/* and there is a bug in D Mars tchar.h prior to 8.39.4n, so define as sprintf */
|
||||
#define wxSprintf sprintf
|
||||
#endif
|
||||
#elif defined(__MINGW32__) && ( defined(_STLPORT_VERSION) && _STLPORT_VERSION >= 0x510 )
|
||||
#if wxUSE_UNICODE
|
||||
/* MinGW with STLPort 5.1 adds count to swprintf (C99) so prototype conversion see wxchar.cpp */
|
||||
int wxSprintf (wchar_t*, const wchar_t*, ...);
|
||||
#else
|
||||
/* MinGW with STLPort 5.1 has clashing defines for _stprintf so use sprintf */
|
||||
#define wxSprintf sprintf
|
||||
#endif
|
||||
#else
|
||||
#define wxSprintf _stprintf
|
||||
#endif
|
||||
@@ -887,9 +895,10 @@ WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */
|
||||
|
||||
/*
|
||||
MinGW MSVCRT has non-standard vswprintf() (for MSVC compatibility
|
||||
presumably) and normally _vsnwprintf() is used instead
|
||||
presumably) and normally _vsnwprintf() is used instead (but as
|
||||
STLPort 5.1 defines standard vswprintf(), don't do this for it)
|
||||
*/
|
||||
#if defined(HAVE_VSWPRINTF) && defined(__MINGW32__)
|
||||
#if defined(HAVE_VSWPRINTF) && defined(__MINGW32__) && !( defined(_STLPORT_VERSION) && _STLPORT_VERSION >= 0x510 )
|
||||
#undef HAVE_VSWPRINTF
|
||||
#endif
|
||||
|
||||
|
@@ -1250,6 +1250,20 @@ int WXDLLEXPORT wxSnprintf_(wxChar *buf, size_t len, const wxChar *format, ...)
|
||||
|
||||
#endif //__DMC__
|
||||
|
||||
#if defined(__MINGW32__) && ( defined(_STLPORT_VERSION) && _STLPORT_VERSION >= 0x510 )
|
||||
/* MinGW with STLPort 5.1 has clashing defines for _stprintf so use swprintf */
|
||||
/* STLPort 5.1 defines standard (C99) vswprintf() and swprintf() that takes count. */
|
||||
int wxSprintf (wchar_t * s, const wchar_t * format, ... )
|
||||
{
|
||||
va_list arglist;
|
||||
|
||||
va_start( arglist, format );
|
||||
int iLen = swprintf ( s, -1, format, arglist );
|
||||
va_end( arglist );
|
||||
return iLen ;
|
||||
}
|
||||
#endif // MINGW32 _STLPORT_VERSION >= 0x510
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// implement the standard IO functions for wide char if libc doesn't have them
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user