]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/wxchar.h
don't mention GUI-only changes in the base section
[wxWidgets.git] / include / wx / wxchar.h
index b2d52c7144bbd2f0dbe5c7ac16102fbd6c9c87e9..31bbb35f476db8f1695a556f4eef400486e581e4 100644 (file)
     #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