+#if wxUSE_THREADS
+ // if we are not in the main thread,
+ // output the assert directly and trap since dialogs cannot be displayed
+ if (!wxThread::IsMain()) {
+ wxStrcat(szBuf, wxT(" [in child thread]"));
+#if defined(__WXMSW__) && !defined(__WXMICROWIN__)
+ wxStrcat(szBuf, wxT("\r\n"));
+ OutputDebugString(szBuf);
+#else
+ // send to stderr
+ wxFprintf(stderr, wxT("%s\n"), szBuf);
+ fflush(stderr);
+#endif
+ // He-e-e-e-elp!! we're asserting in a child thread
+ wxTrap();
+ }
+#endif // wxUSE_THREADS
+