Subject: B20.1: <sys/time.h> missing timercmp macro
From: "Eric Tang" <[email-masked]>
To: <[email-masked]>
Date: Mon, 24 May 1999 23:52:46 +1000

Problem: When compiling cgoban-1.9.5, error reported on missing timercmp.

Solution: In <sys/time.h>, the following should be added:

#ifndef _GNU_H_WINDOWS32_SOCKETS
struct timeval {
  long tv_sec;
  long tv_usec;
};

// <- add the following:
/*
 Operations on timevals.

 NB: timercmp does not work for >= or <=.
 */
#define timerisset(tvp)  ((tvp)->tv_sec || (tvp)->tv_usec)
#define timercmp(tvp, uvp, cmp) \
    (((tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) \
    || (tvp)->tv_sec cmp (uvp)->tv_sec)
#define timerclear(tvp)  ((tvp)->tv_sec = (tvp)->tv_usec = 0)

// <- end of addition

--
Eric

--
Want to unsubscribe from this list?
Send a message to [email-masked]