[m-rev.] for review: add function time__clk_tck/0

David Overton dmo at cs.mu.OZ.AU
Sun Jan 12 21:13:40 AEDT 2003


On Fri, Jan 10, 2003 at 12:58:36PM +0100, Peter Ross wrote:
> On Wed, Jan 08, 2003 at 05:17:14PM +1100, David Overton wrote:
> > +:- func time__c_clk_tck = int.
> > +
> > +:- pragma foreign_proc("C", time__c_clk_tck = (Ret::out),
> > +		[will_not_call_mercury, promise_pure],
> > +"{
> > +#if defined(MR_HAVE_SYSCONF) && defined(_SC_CLK_TCK)
> > +	Ret = (MR_Integer) sysconf(_SC_CLK_TCK);
> > +#elif defined(CLK_TCK)
> > +	/*
> > +	** If sysconf is not available, try using the (obsolete) macro CLK_TCK.
> > +	*/
> > +	Ret = (MR_Integer) CLK_TCK;
> > +#else
> > +	Ret = -1;
> > +#endif
> > +}").
> >  
> You are missing a default implementation for use on the non-C backends.


Estimated hours taken: 0.1
Branches: main

library/time.m:
	Add a default implementation for time__c_clk_tck for use on the non-C
	backends.  Currently it just throws an exception.

Index: time.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/time.m,v
retrieving revision 1.31
diff -u -r1.31 time.m
--- time.m	9 Jan 2003 00:48:57 -0000	1.31
+++ time.m	12 Jan 2003 10:12:21 -0000
@@ -313,6 +313,10 @@
 	Ret = -1;
 #endif
 }").
+time__c_clk_tck = _ :-
+	% This version is only used for back-ends for which there is no
+	% matching foreign_proc version.
+	private_builtin__sorry("time__c_clk_tck").
 
 %-----------------------------------------------------------------------------%
 
-- 
David Overton                  Uni of Melbourne     +61 3 8344 1354
dmo at cs.mu.oz.au                Monash Uni (Clayton) +61 3 9905 5779
http://www.cs.mu.oz.au/~dmo    Mobile Phone         +61 4 0337 4393
--------------------------------------------------------------------------
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