#define WXEXECUTE_NARGS 127
+#if defined(__DARWIN__)
+long wxMacExecute(wxChar **argv,
+ int flags,
+ wxProcess *process);
+#endif
+
long wxExecute( const wxString& command, int flags, wxProcess *process )
{
- wxCHECK_MSG( !command.IsEmpty(), 0, wxT("can't exec empty command") );
+ wxCHECK_MSG( !command.empty(), 0, wxT("can't exec empty command") );
+ wxLogDebug(wxString(wxT("Launching: ")) + command);
#if wxUSE_THREADS
// fork() doesn't mix well with POSIX threads: on many systems the program
} while(*cptr);
argv[argc] = NULL;
+ long lRc;
+#if defined(__DARWIN__)
+ // wxMacExecute only executes app bundles.
+ // It returns an error code if the target is not an app bundle, thus falling
+ // through to the regular wxExecute for non app bundles.
+ lRc = wxMacExecute(argv, flags, process);
+ if( lRc != ((flags & wxEXEC_SYNC) ? -1 : 0))
+ return lRc;
+#endif
+
// do execute the command
- long lRc = wxExecute(argv, flags, process);
+ lRc = wxExecute(argv, flags, process);
// clean up
argc = 0;
return system(wxString::Format(_T("init %c"), level).mb_str()) == 0;
}
+wxPowerType wxGetPowerType()
+{
+ // TODO
+ return wxPOWER_UNKNOWN;
+}
+
+wxBatteryState wxGetBatteryState()
+{
+ // TODO
+ return wxBATTERY_UNKNOWN_STATE;
+}
// ----------------------------------------------------------------------------
// wxStream classes to support IO redirection in wxExecute
#ifdef __VMS
#pragma message disable codeunreachable
#endif
-
+
long wxExecute(wxChar **argv,
int flags,
wxProcess *process)
}
execvp (*mb_argv, mb_argv);
-
+
fprintf(stderr, "execvp(");
// CS changed ppc to ppc_ as ppc is not available under mac os CW Mach-O
for ( char **ppc_ = mb_argv; *ppc_; ppc_++ )
const wxChar* wxGetHomeDir( wxString *home )
{
- *home = wxGetUserHome( wxString() );
+ *home = wxGetUserHome( wxEmptyString );
wxString tmp;
- if ( home->IsEmpty() )
+ if ( home->empty() )
*home = wxT("/");
#ifdef __VMS
tmp = *home;