B20.1: <sys/time.h> missing timercmp macro

Eric Tang etang@ind.tansu.com.au
Mon May 24 07:01:00 GMT 1999


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 cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list