[m-rev.] trivial diff: fix system header check bug

Simon Taylor stayl at cs.mu.OZ.AU
Fri Feb 8 14:42:33 AEDT 2002


Estimated hours taken: 0.1

runtime/mercury_timing.c:
	When checking for sys/times.h, check whether HAVE_SYS_TIMES_H
	is defined, not whether its value is 1.

Index: mercury_timing.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_timing.c,v
retrieving revision 1.6
diff -u -u -r1.6 mercury_timing.c
--- mercury_timing.c	1 Sep 2000 11:49:13 -0000	1.6
+++ mercury_timing.c	8 Feb 2002 03:37:53 -0000
@@ -26,7 +26,7 @@
 int
 MR_get_user_cpu_miliseconds(void)
 {
-#ifdef MR_WIN32_GETPROCESSTIMES
+#if defined(MR_WIN32_GETPROCESSTIMES)
 	#define FILETIME_TO_MILLISEC(time, msec)			\
 	do								\
 	{								\
@@ -48,7 +48,7 @@
 	FILETIME_TO_MILLISEC(user_time, user_msec);
 	FILETIME_TO_MILLISEC(kernel_time, kernel_msec);
 	return user_msec + kernel_msec;
-#elif HAVE_SYS_TIMES_H
+#elif defined(HAVE_SYS_TIMES_H)
   #ifdef MR_CLOCK_TICKS_PER_SECOND
 	const double ticks_per_milisecond = MR_CLOCK_TICKS_PER_SECOND / 1000.0;
 	struct tms t;
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list