#include "wx/process.h"
#include "wx/thread.h"
-#include "wx/unix/execute.h"
+#if wxUSE_GUI
+ #include "wx/unix/execute.h"
+#endif
#include <stdarg.h>
#include <dirent.h>
{
#if defined(HAVE_NANOSLEEP)
timespec tmReq;
- tmReq.tv_sec = milliseconds / 1000;
+ tmReq.tv_sec = (time_t)(milliseconds / 1000);
tmReq.tv_nsec = (milliseconds % 1000) * 1000 * 1000;
// we're not interested in remaining time nor in return value
int wxKill(long pid, wxSignal sig)
{
- return kill(pid, (int)sig);
+ return kill((pid_t)pid, (int)sig);
}
#define WXEXECUTE_NARGS 127
return wxExecute(cmd) != 0;
}
+#if wxUSE_GUI
+
void wxHandleProcessTermination(wxEndProcessData *proc_data)
{
int pid = (proc_data->pid > 0) ? proc_data->pid : -(proc_data->pid);
}
}
-long wxExecute( wxChar **argv, bool sync, wxProcess *process )
+#endif // wxUSE_GUI
+
+#if wxUSE_GUI
+ #define WXUNUSED_UNLESS_GUI(p) p
+#else
+ #define WXUNUSED_UNLESS_GUI(p)
+#endif
+
+long wxExecute(wxChar **argv,
+ bool sync,
+ wxProcess * WXUNUSED_UNLESS_GUI(process))
{
wxCHECK_MSG( *argv, 0, wxT("can't exec empty command") );
#if wxUSE_GUI
wxEndProcessData *data = new wxEndProcessData;
-
ARGS_CLEANUP;
if ( sync )