added HAVE_TIME checks

This commit is contained in:
matthias.ringwald 2011-06-05 09:57:48 +00:00
parent 71341fcdeb
commit 83a9c1a5f4

View File

@ -72,6 +72,7 @@ int embedded_remove_data_source(data_source_t *ds){
* Add timer to run_loop (keep list sorted)
*/
void embedded_add_timer(timer_source_t *ts){
#ifdef HAVE_TIME
linked_item_t *it;
for (it = (linked_item_t *) &timers; it->next ; it = it->next){
if (run_loop_timer_compare( (timer_source_t *) it->next, ts) >= 0) {
@ -82,14 +83,17 @@ void embedded_add_timer(timer_source_t *ts){
it->next = (linked_item_t *) ts;
// log_dbg("Added timer %x at %u\n", (int) ts, (unsigned int) ts->timeout.tv_sec);
// embedded_dump_timer();
#endif
}
/**
* Remove timer from run loop
*/
int embedded_remove_timer(timer_source_t *ts){
#ifdef HAVE_TIME
// log_dbg("Removed timer %x at %u\n", (int) ts, (unsigned int) ts->timeout.tv_sec);
return linked_list_remove(&timers, (linked_item_t *) ts);
#endif
}
void embedded_dump_timer(){