Fix new wxExecute() code compilation with wxUSE_CONSOLE_EVENTLOOP==0.
Nothing is going to work without the console apps/base traits support for the event loop but at least make it compile. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4ec2eca1e8
commit
ccf8bf20ca
@ -49,9 +49,11 @@ public:
|
|||||||
virtual wxFDIOManager *GetFDIOManager();
|
virtual wxFDIOManager *GetFDIOManager();
|
||||||
#endif // wxUSE_SOCKETS
|
#endif // wxUSE_SOCKETS
|
||||||
|
|
||||||
|
#if wxUSE_CONSOLE_EVENTLOOP
|
||||||
// Return a non-NULL pointer to the object responsible for managing the
|
// Return a non-NULL pointer to the object responsible for managing the
|
||||||
// event loop sources in this kind of application.
|
// event loop sources in this kind of application.
|
||||||
virtual wxEventLoopSourcesManagerBase* GetEventLoopSourcesManager();
|
virtual wxEventLoopSourcesManagerBase* GetEventLoopSourcesManager();
|
||||||
|
#endif // wxUSE_CONSOLE_EVENTLOOP
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Wait for the process termination by running the given event loop until
|
// Wait for the process termination by running the given event loop until
|
||||||
|
@ -124,12 +124,16 @@ wxEventLoopBase::AddSourceForFD(int fd,
|
|||||||
wxEventLoopSourceHandler *handler,
|
wxEventLoopSourceHandler *handler,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
|
#if wxUSE_CONSOLE_EVENTLOOP
|
||||||
// Delegate to the event loop sources manager defined by it.
|
// Delegate to the event loop sources manager defined by it.
|
||||||
wxEventLoopSourcesManagerBase* const
|
wxEventLoopSourcesManagerBase* const
|
||||||
manager = wxApp::GetValidTraits().GetEventLoopSourcesManager();
|
manager = wxApp::GetValidTraits().GetEventLoopSourcesManager();
|
||||||
wxCHECK_MSG( manager, NULL, wxS("Must have wxEventLoopSourcesManager") );
|
wxCHECK_MSG( manager, NULL, wxS("Must have wxEventLoopSourcesManager") );
|
||||||
|
|
||||||
return manager->AddSourceForFD(fd, handler, flags);
|
return manager->AddSourceForFD(fd, handler, flags);
|
||||||
|
#else // !wxUSE_CONSOLE_EVENTLOOP
|
||||||
|
return NULL;
|
||||||
|
#endif // wxUSE_CONSOLE_EVENTLOOP/!wxUSE_CONSOLE_EVENTLOOP
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_EVENTLOOP_SOURCE
|
#endif // wxUSE_EVENTLOOP_SOURCE
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include "wx/private/selectdispatcher.h"
|
#include "wx/private/selectdispatcher.h"
|
||||||
#include "wx/private/fdiodispatcher.h"
|
#include "wx/private/fdiodispatcher.h"
|
||||||
#include "wx/unix/execute.h"
|
#include "wx/unix/execute.h"
|
||||||
|
#include "wx/unix/pipe.h"
|
||||||
#include "wx/unix/private.h"
|
#include "wx/unix/private.h"
|
||||||
|
|
||||||
#include "wx/evtloop.h"
|
#include "wx/evtloop.h"
|
||||||
@ -499,6 +500,8 @@ int BlockUntilChildExit(wxExecuteData& execData)
|
|||||||
wxCHECK_MSG( wxTheApp, -1,
|
wxCHECK_MSG( wxTheApp, -1,
|
||||||
wxS("Can't block until child exit without wxTheApp") );
|
wxS("Can't block until child exit without wxTheApp") );
|
||||||
|
|
||||||
|
#if wxUSE_SELECT_DISPATCHER
|
||||||
|
|
||||||
// Even if we don't want to dispatch events, we still need to handle
|
// Even if we don't want to dispatch events, we still need to handle
|
||||||
// child IO notifications and process termination concurrently, i.e.
|
// child IO notifications and process termination concurrently, i.e.
|
||||||
// we can't simply block waiting for the child to terminate as we would
|
// we can't simply block waiting for the child to terminate as we would
|
||||||
@ -553,6 +556,11 @@ int BlockUntilChildExit(wxExecuteData& execData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return execData.exitcode;
|
return execData.exitcode;
|
||||||
|
#else // !wxUSE_SELECT_DISPATCHER
|
||||||
|
wxFAIL_MSG( wxS("Can't block until child exit without wxSelectDispatcher") );
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
#endif // wxUSE_SELECT_DISPATCHER/!wxUSE_SELECT_DISPATCHER
|
||||||
}
|
}
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
@ -1407,8 +1415,14 @@ bool wxHandleFatalExceptions(bool doit)
|
|||||||
|
|
||||||
int wxAppTraits::WaitForChild(wxExecuteData& execData)
|
int wxAppTraits::WaitForChild(wxExecuteData& execData)
|
||||||
{
|
{
|
||||||
|
#if wxUSE_CONSOLE_EVENTLOOP
|
||||||
wxConsoleEventLoop loop;
|
wxConsoleEventLoop loop;
|
||||||
return RunLoopUntilChildExit(execData, loop);
|
return RunLoopUntilChildExit(execData, loop);
|
||||||
|
#else // !wxUSE_CONSOLE_EVENTLOOP
|
||||||
|
wxFAIL_MSG( wxS("Can't wait for child process without wxConsoleEventLoop") );
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
#endif // wxUSE_CONSOLE_EVENTLOOP/!wxUSE_CONSOLE_EVENTLOOP
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function is common code for both console and GUI applications and used
|
// This function is common code for both console and GUI applications and used
|
||||||
|
Loading…
Reference in New Issue
Block a user