[PATCH] turn on timercmp, et al, for Cygwin

Christopher Faylor cgf@redhat.com
Fri Apr 20 20:26:00 GMT 2001


It looks like persistence pays off.  Someone has been sending multiple messages
to the cygwin mailing list complaining that timercmp was "broken" on cygwin.

What he meant by "broken" was "unimplemented".  The minor patch below turns
on the timercmp code for both RTEMS and Cygwin.

Should this just be on by default?  It doesn't add any code anywhere.  It
does pollute the namespace a little, of course.

I've checked this in.

cgf

Fri Apr 20 23:17:51 2001  Christopher Faylor <cgf@cygnus.com>

	* libc/include/sys/time.h: Define timercmp and other macros for
	__CYGWIN__, too.

Index: libc/include/sys/time.h
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/include/sys/time.h,v
retrieving revision 1.3
diff -u -p -r1.3 time.h
--- time.h	2000/12/04 18:40:53	1.3
+++ time.h	2001/04/21 03:17:52
@@ -39,7 +39,7 @@ struct  itimerval {
 };
 
 /* BSD time macros used by RTEMS code */
-#if defined(__rtems__)
+#if defined (__rtems__) || defined (__CYGWIN__)
 
 /* Convenience macros for operations on timevals.
    NOTE: `timercmp' does not work for >= or <=.  */
@@ -68,7 +68,7 @@ struct  itimerval {
       (result)->tv_usec += 1000000;					      \
     }									      \
   } while (0)
-#endif
+#endif /* defined (__rtems__) || defined (__CYGWIN__) */
 
 int _EXFUN(gettimeofday, (struct timeval *__p, struct timezone *__z));
 int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *));



More information about the Newlib mailing list