-#if defined(HAVE_SNPRINTF) && !defined(HAVE_SNPRINTF_DECL)
-#ifdef __cplusplus
- extern "C"
-#else
- extern
-#endif
- WXDLLIMPEXP_BASE int snprintf(char *str, size_t size, const char *format, ...);
-#endif /* !HAVE_SNPRINTF_DECL */
-
-/* Wrapper for vsnprintf if it's 3rd parameter is non-const. Note: the
- * same isn't done for snprintf below, the builtin wxSnprintf_ is used
- * instead since it's already a simple wrapper */
-#if defined __cplusplus && defined HAVE_BROKEN_VSNPRINTF_DECL
- inline int wx_fixed_vsnprintf(char *str, size_t size, const char *format, va_list ap)
- {
- return vsnprintf(str, size, (char*)format, ap);
- }
-#endif
-
-/*
- MinGW MSVCRT has non-standard vswprintf() (for MSVC compatibility
- presumably) and normally _vsnwprintf() is used instead
- */
-#if defined(HAVE_VSWPRINTF) && defined(__MINGW32__)
- #undef HAVE_VSWPRINTF
-#endif
-
-#if wxUSE_PRINTF_POS_PARAMS
- /*
- The systems where vsnprintf() supports positional parameters should
- define the HAVE_UNIX98_PRINTF symbol.
-
- On systems which don't (e.g. Windows) we are forced to use
- our wxVsnprintf() implementation.
- */
- #if defined(HAVE_UNIX98_PRINTF)
- #if wxUSE_UNICODE
- #ifdef HAVE_VSWPRINTF
- #define wxVsnprintf_ vswprintf
- #endif
- #else /* ASCII */
- #ifdef HAVE_BROKEN_VSNPRINTF_DECL
- #define wxVsnprintf_ wx_fixed_vsnprintf
- #else
- #define wxVsnprintf_ vsnprintf
- #endif
- #endif
- #else /* !HAVE_UNIX98_PRINTF */
- /*
- The only compiler with positional parameters support under Windows
- is VC++ 8.0 which provides a new xxprintf_p() functions family.
- The 2003 PSDK includes a slightly earlier version of VC8 than the
- main release and does not have the printf_p functions.
- */
- #if defined _MSC_FULL_VER && _MSC_FULL_VER >= 140050727 && !defined __WXWINCE__
- #if wxUSE_UNICODE
- #define wxVsnprintf_ _vswprintf_p
- #else
- #define wxVsnprintf_ _vsprintf_p
- #endif
- #endif
- #endif /* HAVE_UNIX98_PRINTF/!HAVE_UNIX98_PRINTF */
-#else /* !wxUSE_PRINTF_POS_PARAMS */
- /*
- We always want to define safe snprintf() function to be used instead of
- sprintf(). Some compilers already have it (or rather vsnprintf() which
- we really need...), otherwise we implement it using our own printf()
- code.
-
- We define function with a trailing underscore here because the real one
- is a wrapper around it as explained below
- */
-
- /* first deal with TCHAR-aware compilers which have _vsntprintf */
- #ifndef wxVsnprintf_
- #if defined(__VISUALC__) || \
- (defined(__BORLANDC__) && __BORLANDC__ >= 0x540)
- #define wxSnprintf_ _sntprintf
- #define wxVsnprintf_ _vsntprintf
- WX_DEFINE_VARARG_FUNC(int, wxSnprintf_, _sntprintf)
- #endif
- #endif
-
- /* if this didn't work, define it separately for Unicode and ANSI builds */
- #ifndef wxVsnprintf_
- #if wxUSE_UNICODE
- #if defined(HAVE__VSNWPRINTF)
- #define wxVsnprintf_ _vsnwprintf
- #elif defined(HAVE_VSWPRINTF)
- #define wxVsnprintf_ vswprintf
- #elif defined(__WATCOMC__)
- #define wxVsnprintf_ _vsnwprintf
- WX_DEFINE_VARARG_FUNC(int, wxSnprintf_, _snwprintf)
- #endif
- #else /* ASCII */
- /*
- All versions of CodeWarrior supported by wxWidgets apparently
- have both snprintf() and vsnprintf()
- */
- #if defined(HAVE_SNPRINTF) \
- || defined(__MWERKS__) || defined(__WATCOMC__)
- #ifndef HAVE_BROKEN_SNPRINTF_DECL
- WX_DEFINE_VARARG_FUNC(int, wxSnprintf_, snprintf)
- #endif
- #endif
- #if defined(HAVE_VSNPRINTF) \
- || defined(__MWERKS__) || defined(__WATCOMC__)
- #ifdef HAVE_BROKEN_VSNPRINTF_DECL
- #define wxVsnprintf_ wx_fixed_vsnprintf
- #else
- #define wxVsnprintf_ vsnprintf
- #endif
- #endif
- #endif /* Unicode/ASCII */
- #endif /* wxVsnprintf_ */
-#endif /* wxUSE_PRINTF_POS_PARAMS/!wxUSE_PRINTF_POS_PARAMS */
-
-#ifndef wxSnprintf_
- /* no snprintf(), cook our own */
- WXDLLIMPEXP_BASE int
- wxDoSnprintf_(wxChar *buf, size_t len,
- const wxChar *format, ...) ATTRIBUTE_PRINTF_3;
- WX_DEFINE_VARARG_FUNC(int, wxSnprintf_, wxDoSnprintf_)
-#endif
-#ifndef wxVsnprintf_
- /* no (suitable) vsnprintf(), cook our own */
- WXDLLIMPEXP_BASE int
- wxVsnprintf_(wxChar *buf, size_t len,
- const wxChar *format, va_list argptr);
-
- #define wxUSE_WXVSNPRINTF 1
-#else
- #define wxUSE_WXVSNPRINTF 0
-#endif