X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Ftimer.hh;h=556475c19296a7828f6bb3314e246d0a20aa69d2;hb=e451c08ac5a103362adbece9b8a11a16ade739c1;hp=0ca8be8d83af025e12c44da48b6c5b255f4b4c05;hpb=c4427cc1f338a6b754038929e0ec78e8148e04b0;p=chaz%2Fopenbox 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