fix build on Mac

This commit is contained in:
Seven Du 2013-11-16 09:58:46 +08:00
parent 34ebd6fb59
commit 50857cc82d
1 changed files with 12 additions and 0 deletions

View File

@ -676,9 +676,11 @@ static switch_status_t timer_init(switch_timer_t *timer)
timer_private_t *private_info;
int sanity = 0;
#ifdef HAVE_TIMERFD_CREATE
if (TFD == 2) {
return _timerfd_init(timer);
}
#endif
while (globals.STARTED == 0) {
do_sleep(100000);
@ -741,9 +743,11 @@ static switch_status_t timer_step(switch_timer_t *timer)
timer_private_t *private_info;
uint64_t samples;
#ifdef HAVE_TIMERFD_CREATE
if (TFD == 2) {
return _timerfd_step(timer);
}
#endif
private_info = timer->private_info;
@ -769,9 +773,11 @@ static switch_status_t timer_sync(switch_timer_t *timer)
{
timer_private_t *private_info;
#ifdef HAVE_TIMERFD_CREATE
if (TFD == 2) {
return _timerfd_sync(timer);
}
#endif
private_info = timer->private_info;
@ -800,9 +806,11 @@ static switch_status_t timer_next(switch_timer_t *timer)
#endif
int delta;
#ifdef HAVE_TIMERFD_CREATE
if (TFD == 2) {
return _timerfd_next(timer);
}
#endif
private_info = timer->private_info;
@ -851,9 +859,11 @@ static switch_status_t timer_check(switch_timer_t *timer, switch_bool_t step)
timer_private_t *private_info;
switch_status_t status = SWITCH_STATUS_SUCCESS;
#ifdef HAVE_TIMERFD_CREATE
if (TFD == 2) {
return _timerfd_check(timer, step);
}
#endif
private_info = timer->private_info;
@ -885,9 +895,11 @@ static switch_status_t timer_destroy(switch_timer_t *timer)
{
timer_private_t *private_info;
#ifdef HAVE_TIMERFD_CREATE
if (TFD == 2) {
return _timerfd_destroy(timer);
}
#endif
private_info = timer->private_info;