]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utilsexc.cpp
more informative error messages
[wxWidgets.git] / src / msw / utilsexc.cpp
index 3db9fa141966b2373fa02c2d3b643fbb242228de..3fb6d493fe743285aa50b096b484e83a2d58faf6 100644 (file)
@@ -60,7 +60,9 @@
 #endif
 
 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
-#include <io.h>
+#ifndef __UNIX__
+    #include <io.h>
+#endif
 
 #ifndef __GNUWIN32__
 #include <shellapi.h>
@@ -490,6 +492,14 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler)
 {
     wxCHECK_MSG( !!cmd, 0, wxT("empty command in wxExecute") );
 
+#if wxUSE_THREADS
+    // for many reasons, the code below breaks down if it's called from another
+    // thread -- this could be fixed, but as Unix versions don't support this
+    // neither I don't want to waste time on this now
+    wxASSERT_MSG( wxThread::IsMain(),
+                    _T("wxExecute() can be called only from the main thread") );
+#endif // wxUSE_THREADS
+
     wxString command;
 
 #if wxUSE_IPC