X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a12698abb72c090dba6907506781ae979b0ef606..64ea838d8f4d1853b7d850db93ee565e901d099a:/src/common/selectdispatcher.cpp diff --git a/src/common/selectdispatcher.cpp b/src/common/selectdispatcher.cpp index 1365319347..fd0a26938c 100644 --- a/src/common/selectdispatcher.cpp +++ b/src/common/selectdispatcher.cpp @@ -5,7 +5,7 @@ // Created: December 2006 // RCS-ID: $Id$ // Copyright: (c) 2006 Lukasz Michalski -// License: wxWindows licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -19,6 +19,10 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + #if wxUSE_SELECT_DISPATCHER #include "wx/private/selectdispatcher.h" @@ -30,11 +34,6 @@ #include "wx/intl.h" #endif -#if defined(HAVE_SYS_SELECT_H) || defined(__WATCOMC__) - #include - #include -#endif - #include #define wxSelectDispatcher_Trace wxT("selectdispatcher") @@ -89,7 +88,7 @@ bool wxSelectSets::HasFD(int fd) const bool wxSelectSets::SetFD(int fd, int flags) { - wxCHECK_MSG( fd >= 0, false, _T("invalid descriptor") ); + wxCHECK_MSG( fd >= 0, false, wxT("invalid descriptor") ); for ( int n = 0; n < Max; n++ ) { @@ -118,7 +117,7 @@ bool wxSelectSets::Handle(int fd, wxFDIOHandler& handler) const if ( wxFD_ISSET(fd, (fd_set*) &m_fds[n]) ) { wxLogTrace(wxSelectDispatcher_Trace, - _T("Got %s event on fd %d"), ms_names[n], fd); + wxT("Got %s event on fd %d"), ms_names[n], fd); (handler.*ms_handlers[n])(); // callback can modify sets and destroy handler // this forces that one event can be processed at one time @@ -145,7 +144,7 @@ bool wxSelectDispatcher::RegisterFD(int fd, wxFDIOHandler *handler, int flags) m_maxFD = fd; wxLogTrace(wxSelectDispatcher_Trace, - _T("Registered fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT), (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION); + wxT("Registered fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT), (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION); return true; } @@ -154,10 +153,10 @@ bool wxSelectDispatcher::ModifyFD(int fd, wxFDIOHandler *handler, int flags) if ( !wxMappedFDIODispatcher::ModifyFD(fd, handler, flags) ) return false; - wxASSERT_MSG( fd <= m_maxFD, _T("logic error: registered fd > m_maxFD?") ); + wxASSERT_MSG( fd <= m_maxFD, wxT("logic error: registered fd > m_maxFD?") ); wxLogTrace(wxSelectDispatcher_Trace, - _T("Modified fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT) == wxFDIO_OUTPUT, (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION); + wxT("Modified fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT) == wxFDIO_OUTPUT, (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION); return m_sets.SetFD(fd, flags); } @@ -188,7 +187,7 @@ bool wxSelectDispatcher::UnregisterFD(int fd) } wxLogTrace(wxSelectDispatcher_Trace, - _T("Removed fd %d, current max: %d"), fd, m_maxFD); + wxT("Removed fd %d, current max: %d"), fd, m_maxFD); return true; } @@ -203,7 +202,7 @@ int wxSelectDispatcher::ProcessSets(const wxSelectSets& sets) wxFDIOHandler * const handler = FindHandler(fd); if ( !handler ) { - wxFAIL_MSG( _T("NULL handler in wxSelectDispatcher?") ); + wxFAIL_MSG( wxT("NULL handler in wxSelectDispatcher?") ); continue; } @@ -221,8 +220,8 @@ int wxSelectDispatcher::DoSelect(wxSelectSets& sets, int timeout) const if ( timeout != TIMEOUT_INFINITE ) { ptv = &tv; - tv.tv_sec = 0; - tv.tv_usec = timeout*1000; + tv.tv_sec = timeout / 1000; + tv.tv_usec = (timeout % 1000)*1000; } else // no timeout {