-// use unsafer wxStrlen:
-inline size_t wxStrnlen(const char *str, size_t maxlen) { return wxCRT_StrlenA(str); wxUnusedVar(maxlen); }
-inline size_t wxStrnlen(const wchar_t *str, size_t maxlen) { return wxCRT_StrlenW(str); wxUnusedVar(maxlen); }
+inline size_t wxStrnlen(const wchar_t *str, size_t maxlen)
+{
+ size_t n;
+ for ( n = 0; n < maxlen; n++ )
+ if ( !str[n] )
+ break;
+
+ return n;
+}