X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b12915c104de03c9fd5102404e35051e9b8609a8..897d36c241792481562f089ad57c7ec74645894d:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index b627f69ff0..3b09340bec 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -25,7 +25,9 @@ #include "wx/process.h" #include "wx/thread.h" -#include "wx/unix/execute.h" +#if wxUSE_GUI + #include "wx/unix/execute.h" +#endif #include #include @@ -97,7 +99,7 @@ void wxUsleep(unsigned long milliseconds) { #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 @@ -126,7 +128,7 @@ void wxUsleep(unsigned long milliseconds) int wxKill(long pid, wxSignal sig) { - return kill(pid, (int)sig); + return kill((pid_t)pid, (int)sig); } #define WXEXECUTE_NARGS 127 @@ -212,6 +214,8 @@ bool wxShell(const wxString& command) return wxExecute(cmd) != 0; } +#if wxUSE_GUI + void wxHandleProcessTermination(wxEndProcessData *proc_data) { int pid = (proc_data->pid > 0) ? proc_data->pid : -(proc_data->pid); @@ -262,7 +266,17 @@ void wxHandleProcessTermination(wxEndProcessData *proc_data) } } -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") ); @@ -364,7 +378,6 @@ long wxExecute( wxChar **argv, bool sync, wxProcess *process ) #if wxUSE_GUI wxEndProcessData *data = new wxEndProcessData; - ARGS_CLEANUP; if ( sync )