X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/66ee25523a09eb1db2773cecc44e39d6f7f76598..418b74a078f6502deff7ad4a4d562b9cc496774d:/include/wx/wxchar.h diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index b2d52c7144..31bbb35f47 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -535,14 +535,9 @@ #endif #endif // !defined(wxStricmp) -// checks whether the passed in pointer is NULL and if the string is empty -inline bool wxIsEmpty(const wxChar *p) { return !p || !*p; } - -// safe version of strlen() (returns 0 if passed NULL pointer) -inline size_t wxStrlen(const wxChar *psz) { return psz ? wxStrlen_(psz) : 0; } - // define wxWcslen() which should be always available if wxUSE_WCHAR_T == 1 (as -// it's used in wx/buffer.h) +// it's used in wx/buffer.h -- and also might be used just below by wxStrlen() +// when wxStrlen_() is #define'd as wxWcslen so do it before defining wxStrlen) #if wxUSE_WCHAR_T #ifdef HAVE_WCSLEN #define wxWcslen wcslen @@ -558,6 +553,12 @@ inline size_t wxStrlen(const wxChar *psz) { return psz ? wxStrlen_(psz) : 0; } #endif #endif // wxUSE_WCHAR_T +// checks whether the passed in pointer is NULL and if the string is empty +inline bool wxIsEmpty(const wxChar *p) { return !p || !*p; } + +// safe version of strlen() (returns 0 if passed NULL pointer) +inline size_t wxStrlen(const wxChar *psz) { return psz ? wxStrlen_(psz) : 0; } + WXDLLEXPORT bool wxOKlibc(); // for internal use // ---------------------------------------------------------------------------- @@ -575,7 +576,10 @@ WXDLLEXPORT bool wxOKlibc(); // for internal use */ #ifndef wxVsnprintf_ #if wxUSE_UNICODE - #if defined(HAVE_VSWPRINTF) + #if defined(HAVE__VSNWPRINTF) + #define wxVsnprintf_ _vsnwprintf + /* MinGW?MSVCRT has the wrong vswprintf */ + #elif defined(HAVE_VSWPRINTF) && !defined(__MINGW32__) #define wxVsnprintf_ vswprintf #endif #else // ASCII @@ -589,10 +593,12 @@ WXDLLEXPORT bool wxOKlibc(); // for internal use #endif #endif // wxVsnprintf_ not defined yet -#ifndef wxVsnprintf_ +#ifndef wxSnprintf_ // no [v]snprintf(), cook our own WXDLLEXPORT int wxSnprintf_(wxChar *buf, size_t len, const wxChar *format, ...) ATTRIBUTE_PRINTF_3; +#endif +#ifndef wxVsnprintf_ WXDLLEXPORT int wxVsnprintf_(wxChar *buf, size_t len, const wxChar *format, va_list argptr); #endif