]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix build on Mac
authorSeven Du <dujinfang@gmail.com>
Sat, 16 Nov 2013 01:58:46 +0000 (09:58 +0800)
committerSeven Du <dujinfang@gmail.com>
Sat, 16 Nov 2013 01:59:00 +0000 (09:59 +0800)
src/switch_time.c

index 426cba822a38f64bcd9d0fa83c7de573aa601508..c4b6b8b4456dc5d99af245987dfa8f822eafc261 100644 (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;