summaryrefslogtreecommitdiff
path: root/otk/timer.hh
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-02-09 23:07:54 +0000
committerDana Jansens <danakj@orodu.net>2003-02-09 23:07:54 +0000
commit115fedf432d73f17ade48eaa2fa12dfd333bfcaa (patch)
tree9cc7cce7b1f627457813d5d9dbf7b121164a0446 /otk/timer.hh
parent74cfb1b4c115cdb4e05aa823b09d2b5ea9d0d690 (diff)
use the c++ std cheaders
Diffstat (limited to 'otk/timer.hh')
-rw-r--r--otk/timer.hh15
1 files changed, 4 insertions, 11 deletions
diff --git a/otk/timer.hh b/otk/timer.hh
index 0ca8be8d..556475c1 100644
--- a/otk/timer.hh
+++ b/otk/timer.hh
@@ -7,16 +7,7 @@
*/
extern "C" {
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else // !TIME_WITH_SYS_TIME
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else // !HAVE_SYS_TIME_H
-# include <time.h>
-# endif // HAVE_SYS_TIME_H
-#endif // TIME_WITH_SYS_TIME
+#include <ctime>
}
#include <queue>
@@ -39,7 +30,9 @@ private:
struct TimerCompare {
//! Compares two timeval structs
inline bool operator()(const Timer *a, const Timer *b) const {
- return timercmp(&a->_timeout, &b->_timeout, >);
+ return ((&a->_timeout)->tv_sec == (&b->_timeout)->tv_sec) ?
+ ((&a->_timeout)->tv_usec > (&b->_timeout)->tv_usec) :
+ ((&a->_timeout)->tv_sec > (&b->_timeout)->tv_sec);
}
};
friend struct TimerCompare; // give access to _timeout for shitty compilers