Use std::unordered_map<> in Unix wxAppConsole
Replace a wx synonym with the direct use of the standard class.
This commit is contained in:
parent
f0eed0a102
commit
7b2baeacee
2 changed files with 6 additions and 7 deletions
|
|
@ -10,6 +10,8 @@
|
|||
//Ensure that sigset_t is being defined
|
||||
#include <signal.h>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
class wxFDIODispatcher;
|
||||
class wxFDIOHandler;
|
||||
class wxWakeUpPipe;
|
||||
|
|
@ -64,8 +66,7 @@ private:
|
|||
sigset_t m_signalsCaught;
|
||||
|
||||
// the signal handlers
|
||||
WX_DECLARE_HASH_MAP(int, SignalHandler, wxIntegerHash, wxIntegerEqual, SignalHandlerHash);
|
||||
SignalHandlerHash m_signalHandlerHash;
|
||||
std::unordered_map<int, SignalHandler> m_signalHandlerHash;
|
||||
|
||||
// pipe used for wake up signal handling: if a signal arrives while we're
|
||||
// blocking for input, writing to this pipe triggers a call to our CheckSignal()
|
||||
|
|
|
|||
|
|
@ -115,15 +115,13 @@ void wxAppConsole::HandleSignal(int signal)
|
|||
|
||||
void wxAppConsole::CheckSignal()
|
||||
{
|
||||
for ( SignalHandlerHash::iterator it = m_signalHandlerHash.begin();
|
||||
it != m_signalHandlerHash.end();
|
||||
++it )
|
||||
for ( const auto& kv : m_signalHandlerHash )
|
||||
{
|
||||
int sig = it->first;
|
||||
int sig = kv.first;
|
||||
if ( sigismember(&m_signalsCaught, sig) )
|
||||
{
|
||||
sigdelset(&m_signalsCaught, sig);
|
||||
(it->second)(sig);
|
||||
(kv.second)(sig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue