X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2f1ae4143271ae63a17e052a1a471d16e9cd8c44..94e2ed3b8db0220160c0b939782cd46914ec073a:/src/mac/carbon/timer.cpp?ds=sidebyside diff --git a/src/mac/carbon/timer.cpp b/src/mac/carbon/timer.cpp index 3d0bb31c08..f2b5f2e896 100644 --- a/src/mac/carbon/timer.cpp +++ b/src/mac/carbon/timer.cpp @@ -21,13 +21,13 @@ IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) static void wxProcessTimer( unsigned long event , void *data ) ; -pascal void MacTimerProc( TMTask * t ) +static pascal void MacTimerProc( TMTask * t ) { MacTimerInfo * tm = (MacTimerInfo*) t ; wxMacAddEvent( tm->m_table , wxProcessTimer, 0 , (void*) tm->m_timer , TRUE ) ; } -void wxProcessTimer( unsigned long event , void *data ) +static void wxProcessTimer( unsigned long event , void *data ) { if ( !data ) return ; @@ -44,7 +44,7 @@ void wxProcessTimer( unsigned long event , void *data ) } } -wxTimer::wxTimer() +void wxTimer::Init() { m_info.m_task.tmAddr = NULL ; m_info.m_task.tmWakeUp = 0 ; @@ -72,9 +72,15 @@ bool wxTimer::Start(int milliseconds,bool mode) wxCHECK_MSG( m_info.m_task.tmAddr == NULL , FALSE, wxT("attempting to restart a timer") ); m_milli = milliseconds; - m_info.m_task.tmAddr = NewTimerProc( MacTimerProc ) ; - m_info.m_task.tmWakeUp = 0 ; - m_info.m_task.tmReserved = 0 ; +#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340) + m_info.m_task.tmAddr = NewTimerUPP( MacTimerProc ) ; +#else + m_info.m_task.tmAddr = NewTimerProc( MacTimerProc ) ; +#endif + m_info.m_task.tmWakeUp = 0 ; + m_info.m_task.tmReserved = 0 ; + m_info.m_task.qType = 0 ; + m_info.m_timer = this ; InsXTime((QElemPtr) &m_info.m_task ) ; PrimeTime( (QElemPtr) &m_info.m_task , m_milli ) ; return FALSE;