From: Todd C. Miller Date: Thu, 22 Apr 2010 14:37:20 +0000 (-0400) Subject: Add timercmp macro for systems without it X-Git-Tag: SUDO_1_8_0~706 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2bc52eb394bab7f0d4ad9829bca2942201cdc45d;p=sudo Add timercmp macro for systems without it --- diff --git a/include/compat.h b/include/compat.h index 3e332ca52..1872728aa 100644 --- a/include/compat.h +++ b/include/compat.h @@ -280,6 +280,12 @@ void setprogname(const char *); } \ } while (0) #endif +#ifndef timercmp +#define timercmp(tv1, tv2, cmp) \ + (((tv1)->tv_sec == (tv2)->tv_sec) ? \ + ((tv1)->tv_usec cmp (tv2)->tv_usec) : \ + ((tv1)->tv_sec cmp (tv2)->tv_sec)) +#endif #ifndef WCOREDUMP # define WCOREDUMP(x) ((x) & 0x80)