+#else
+
+// #pragma error Broken implementation of wxMatchWild() -- needs fixing!
+
+ /*
+ * WARNING: this code is broken!
+ */
+{
+ wxString tmp1 = pat;
+ wxChar *pattern = WXSTRINGCAST(tmp1);
+ wxString tmp2 = text;
+ wxChar *str = WXSTRINGCAST(tmp2);
+ wxChar c;
+ wxChar *cp;
+ bool done = FALSE, ret_code, ok;
+ // Below is for vi fans
+ const wxChar OB = wxT('{'), CB = wxT('}');
+
+ // dot_special means '.' only matches '.'
+ if (dot_special && *str == wxT('.') && *pattern != *str)
+ return FALSE;
+
+ while ((*pattern != wxT('\0')) && (!done)
+ && (((*str==wxT('\0'))&&((*pattern==OB)||(*pattern==wxT('*'))))||(*str!=wxT('\0')))) {
+ switch (*pattern) {
+ case wxT('\\'):
+ pattern++;
+ if (*pattern != wxT('\0'))
+ pattern++;
+ break;
+ case wxT('*'):
+ pattern++;
+ ret_code = FALSE;
+ while ((*str!=wxT('\0'))
+ && ((ret_code=wxMatchWild(pattern, str++, FALSE)) == 0))
+ /*loop*/;
+ if (ret_code) {
+ while (*str != wxT('\0'))
+ str++;
+ while (*pattern != wxT('\0'))
+ pattern++;
+ }
+ break;
+ case wxT('['):
+ pattern++;
+ repeat:
+ if ((*pattern == wxT('\0')) || (*pattern == wxT(']'))) {
+ done = TRUE;
+ break;
+ }
+ if (*pattern == wxT('\\')) {
+ pattern++;
+ if (*pattern == wxT('\0')) {
+ done = TRUE;
+ break;
+ }
+ }
+ if (*(pattern + 1) == wxT('-')) {
+ c = *pattern;
+ pattern += 2;
+ if (*pattern == wxT(']')) {
+ done = TRUE;
+ break;
+ }
+ if (*pattern == wxT('\\')) {
+ pattern++;
+ if (*pattern == wxT('\0')) {
+ done = TRUE;
+ break;
+ }
+ }
+ if ((*str < c) || (*str > *pattern)) {
+ pattern++;
+ goto repeat;
+ }
+ } else if (*pattern != *str) {
+ pattern++;
+ goto repeat;
+ }
+ pattern++;
+ while ((*pattern != wxT(']')) && (*pattern != wxT('\0'))) {
+ if ((*pattern == wxT('\\')) && (*(pattern + 1) != wxT('\0')))
+ pattern++;
+ pattern++;
+ }
+ if (*pattern != wxT('\0')) {
+ pattern++, str++;
+ }
+ break;
+ case wxT('?'):
+ pattern++;
+ str++;
+ break;
+ case OB:
+ pattern++;
+ while ((*pattern != CB) && (*pattern != wxT('\0'))) {
+ cp = str;
+ ok = TRUE;
+ while (ok && (*cp != wxT('\0')) && (*pattern != wxT('\0'))
+ && (*pattern != wxT(',')) && (*pattern != CB)) {
+ if (*pattern == wxT('\\'))
+ pattern++;
+ ok = (*pattern++ == *cp++);
+ }
+ if (*pattern == wxT('\0')) {
+ ok = FALSE;
+ done = TRUE;
+ break;
+ } else if (ok) {
+ str = cp;
+ while ((*pattern != CB) && (*pattern != wxT('\0'))) {
+ if (*++pattern == wxT('\\')) {
+ if (*++pattern == CB)
+ pattern++;
+ }
+ }
+ } else {
+ while (*pattern!=CB && *pattern!=wxT(',') && *pattern!=wxT('\0')) {
+ if (*++pattern == wxT('\\')) {
+ if (*++pattern == CB || *pattern == wxT(','))
+ pattern++;
+ }
+ }
+ }
+ if (*pattern != wxT('\0'))
+ pattern++;
+ }
+ break;
+ default:
+ if (*str == *pattern) {
+ str++, pattern++;
+ } else {
+ done = TRUE;
+ }
+ }
+ }
+ while (*pattern == wxT('*'))
+ pattern++;
+ return ((*str == wxT('\0')) && (*pattern == wxT('\0')));
+};
+
+#endif
+
+#ifdef __VISUALC__
+ #pragma warning(default:4706) // assignment within conditional expression
+#endif // VC++
+
+//------------------------------------------------------------------------
+// Missing functions in Unicode for Win9x
+//------------------------------------------------------------------------
+
+// NB: MSLU only covers Win32 API, it doesn't provide Unicode implementation of
+// libc functions. Unfortunately, some of MSVCRT wchar_t functions
+// (e.g. _wopen) don't work on Windows 9x, so we have to workaround it
+// by calling the char version. We still want to use wchar_t version on
+// NT/2000/XP, though, because they allow for Unicode file names.
+#if wxUSE_UNICODE_MSLU
+
+ #if defined( __VISUALC__ ) \
+ || ( defined(__MINGW32__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \
+ || ( defined(__MWERKS__) && defined(__WXMSW__) )
+ WXDLLEXPORT int wxOpen(const wxChar *name, int flags, int mode)
+ {
+ if ( wxGetOsVersion() == wxWINDOWS_NT )
+ return _wopen(name, flags, mode);
+ else
+ return _open(wxConvFile.cWX2MB(name), flags, mode);
+ }
+ #endif
+
+#endif // wxUSE_UNICODE_MSLU