/*------------------------->  Sather - configfile  <-------------------------*/
/* Copyright (C) 2000 by K Hopper, University of Waikato, New Zealand        */
/* 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 SYS_CONFIG
#define SYS_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 $$;"

SYS_DESTROY:	VPP,
		exec "SYSDESTROY($1);",
		f_exec "if(^0) SYSDESTROY($1); else F_SYSDESTROY($1);";
SYS_ID:		PP,VSTD,
		exec "$$=SYSID($1);" "$$",
		f_exec "$$=^0?SYSID($1):F_SYSID($1);" "$$";
SYS_TP:		PP,VSTD,
		exec "$$=SYSTP($1);" "$$",
		f_exec "$$=^0?SYSTP($1):F_SYSTP($1);" "$$";
SYS_STR_FOR_TP: PP,VSTD,
		exec "$$=SYSSTRFORTP($1);" "$$";
SYS_OB_EQ:	PP,VSTD,
		exec "$$=SYSOBEQ($1,$2);" "$$",
		f_exec "$$=(^0&&^1)?SYSOBEQ($1,$2):F_SYSOBEQ($1,$2);" "$$";
SYS_IMPORT:	import,PP, exec "SYS_IMPORT;";
SYS_EXPORT:	export,PP,exec "SYS_EXPORT;";
SYS_DEFER:	PP,exec "SYS_DEFER;";
SYS_PSATHER_STATISTICS:	exec "use_statistics((int)$1);";
SYS_PSATHER_TRACE:	exec "use_trace((int)$1);";

--   Following is a dummy 'fix' - depends on compiler numbering immutables < 0!
SYS_IMMUTABLE:	PP,VSTD, exec "$$= TAG($1) < 0;" "$$";


-- SYS_RUNES_FOR_GIVEN_TYPE:		handled within the compiler itself
SYS_RUNES_FOR_GIVEN_TYPE:	PP,exec "$$=0;" "$$";

SYS_EXT_OB_VAL:			PP,VSTD,exec "$$=SYSEXTOBVAL($1);" "$$";
SYS_EXT_OB_PTR:			PP,VSTD, exec "$$=SYSEXTOBPTR($1);" "$$";
SYS_EXT_OB_FOR: 			PP,VSTD,exec "$$=SYSEXTOBFOR($1);" "$$";

FILE_STDIN:		PP ,declare "#include <stdio.h>" ,exec "stdin";
FILE_STDOUT:	PP ,declare "#include <stdio.h>" ,exec "stdout";
FILE_STDERR:	PP ,declare "#include <stdio.h>" ,exec "stderr";

#endif
