From 115fedf432d73f17ade48eaa2fa12dfd333bfcaa Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 9 Feb 2003 23:07:54 +0000 Subject: use the c++ std cheaders --- otk/timer.hh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'otk/timer.hh') 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 -# include -#else // !TIME_WITH_SYS_TIME -# ifdef HAVE_SYS_TIME_H -# include -# else // !HAVE_SYS_TIME_H -# include -# endif // HAVE_SYS_TIME_H -#endif // TIME_WITH_SYS_TIME +#include } #include @@ -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 -- cgit v1.2.3