----------------->  GNU Sather - compiler configuration file  <----------------
-- Copyright (C) 199x by International Computer Science Institute            --
-- This file is part of the GNU Sather library. It is free software; you may --
-- redistribute  and/or modify it under the terms of the GNU Library General --
-- Public  License (LGPL)  as published  by the  Free  Software  Foundation; --
-- either version 2 of the license, or (at your option) any later version.   --
-- This  library  is distributed  in the  hope that it will  be  useful, but --
-- WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See Doc/LGPL for more details.       --
-- The license text is also available from:  Free Software Foundation, Inc., --
-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                     --
-------------->  Please email comments to <bug-sather@gnu.org>  <--------------

#ifndef TIME_CONFIG
#define TIME_CONFIG

#ifdef PP
#undef PP
#endif

#ifdef APP
#undef APP
#endif

#ifdef VPP
#undef VPP
#endif

#ifdef FPP
#undef FPP
#endif

#ifdef VSTD
#undef VSTD
#endif

#define PP	no_pre,no_post
#define VPP	volatile,PP
#define VSTD	var "@r $$;"

TIME_SECONDS:	VPP,VSTD,exec "$$=(FLTD)time(NULL);" "$$";

TIMES_NOW:	VPP,declare "#include <sys/times.h>" "#include <limits.h>",
	        var "struct tms $$;",
	        exec "$0->$.wall_time=times(&$$);"
		     "$0->$.sys_time=$$.tms_stime;"
		     "$0->$.user_time=$$.tms_utime;"
		     "$0->$.child_sys_time=$$.tms_cstime;"
		     "$0->$.child_user_time=$$.tms_cutime;";
TIMES_CLK:	PP,VSTD,exec "$$=CLK_TCK;",declare "#include <limits.h>";

MEMORY_NOW:	PP,exec "$0->$.sbrk_size=(long)sbrk(0);"
		        "$0->$.gc_size=(long)GC_get_heap_size();";

#endif 
