/*
    config.h.in -- Template configuration file.
*/
/*
    Copyright (c) 1990, Giuseppe Attardi.
    Copyright (c) 2001, Juan Jose Garcia Ripoll.

    ECoLisp is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    See file '../Copyright' for full details.
*/

/*
 * FEATURES LINKED IN
 */
/* Always use CLOS							*/
#define CLOS

/* Use Boehm's garbage collector					*/
#undef GBC_BOEHM
#ifdef GBC_BOEHM
#define ECL_DYNAMIC_VV
#endif

/* Userland threads?							*/
#undef ECL_THREADS

/* __thread thread-local variables?                                     */
#undef WITH___THREAD

/* Network streams							*/
#undef TCP
#if defined(TCP) && (defined(_MSC_VER) || defined(mingw32))
# define ECL_WSOCK
#endif

/* Foreign functions interface						*/
#undef ECL_FFI

/*
 * C TYPES AND SYSTEM LIMITS
 */
/*
 * The integer type
 *
 * cl_fixnum must be an integer type, large enough to hold a pointer.
 * Ideally, according to the ISOC99 standard, we should use intptr_t,
 * but the required headers are not present in all systems. Hence we
 * use autoconf to guess the following values.
 */
#define FIXNUM_BITS		64
#define MOST_POSITIVE_FIXNUM	((cl_fixnum)2305843009213693951)
#define MOST_NEGATIVE_FIXNUM	((cl_fixnum)-2305843009213693952)

typedef long int cl_fixnum;
typedef unsigned long int cl_index;
typedef unsigned long int cl_hashkey;

/*
 * The character type
 */
#define	CHAR_CODE_LIMIT		256

/*
 * Array limits
 */
#define	ARANKLIM	64		/*  array rank limit  		*/
#ifdef GBC_BOEHM
#define	ADIMLIM		2305843009213693951	/*  array dimension limit	*/
#define	ATOTLIM		2305843009213693951	/*  array total limit		*/
#else
#define	ADIMLIM		16*1024*1024	/*  array dimension limit	*/
#define	ATOTLIM		16*1024*1024	/*  array total limit		*/
#endif

/*
 * Function limits.
 *
 * In general, any of these limits must fit in a "signed int".
 */
/*	Maximum number of function arguments 				*/
#define CALL_ARGUMENTS_LIMIT 65536

/*	Maximum number of required arguments				*/
#define LAMBDA_PARAMETERS_LIMIT 64

/*	Numb. of args. which can be passed using the C stack		*/
/*	See cmplam.lsp if you change this value				*/
#define C_ARGUMENTS_LIMIT 64

/*	Maximum number of output arguments				*/
#define ECL_MULTIPLE_VALUES_LIMIT 64

/* A setjmp that does not save signals					*/
#define ecl_setjmp	_setjmp
#define ecl_longjmp	_longjmp

/*
 * Structure/Instance limits. The index to a slot must fit in the
 * "int" type. We also require ECL_SLOTS_LIMIT <= CALL_ARGUMENTS_LIMIT
 * because constructors typically require as many arguments as slots,
 * or more.
 */
#define ECL_SLOTS_LIMIT	32768

/* -CUT-: Everything below this mark will not be installed		*/
/* -------------------------------------------------------------------- *
 *	BUILD OPTIONS WHICH NEED NOT BE EXPORTED			*
 * -------------------------------------------------------------------- */
/*
 * FEATURES LINKED IN:
 */

/* CLX									*/
#undef CLX
/* Locatives								*/
#undef LOCATIVE
/* Use old MIT LOOP macro system					*/
#undef ECL_OLD_LOOP

/* Define this if you want a runtime version only without compiler	*/
#undef RUNTIME
/* Profile tool								*/
#undef PROFILE
/* Program Development Environment					*/
#undef PDE

/* Tcl/Tk library							*/
#undef TK

/* Allow loading dynamically linked code				*/
#undef ENABLE_DLOPEN

/* Undefine this if you do not want ECL to check for circular lists	*/
#define ECL_SAFE

/* Allow STREAM operations to work on arbitrary objects			*/
#undef ECL_CLOS_STREAMS

/* Use CMU Common-Lisp's FORMAT routine					*/
#undef ECL_CMU_FORMAT

/* Bytecodes and arguments are 8 and 16 bits large, respectively	*/
#undef ECL_SMALL_BYTECODES

/*
 * SYSTEM FEATURES:
 */

/* Stack grows downwards						*/
#undef DOWN_STACK
/* Arguments cannot be accessed as array				*/
#undef NO_ARGS_ARRAY
/* Most significant byte first						*/
#undef WORDS_BIGENDIAN
/* Has <sys/resource.h>							*/
#undef HAVE_SYS_RESOURCE_H
#undef HAVE_ULIMIT_H
/* High precision timer							*/
#undef HAVE_NANOSLEEP
/* Float version if isnan()						*/
#undef HAVE_ISNANF
/* float.h for epsilons, maximum real numbers, etc			*/
#undef HAVE_FLOAT_H
/* select()								*/
#undef HAVE_SELECT
#undef HAVE_SYS_IOCTL_H
/* putenv() or setenv()							*/
#undef HAVE_SETENV
#undef HAVE_PUTENV
/* times() and sys/times.h						*/
#undef HAVE_TIMES
/* user home directory, user name, etc...				*/
#undef HAVE_PW_H
/* symbolic links and checking their existence				*/
#undef HAVE_LSTAT
/* safe creation of temporary files					*/
#undef HAVE_MKSTEMP
/* timer for userland threads						*/
#undef HAVE_ALARM
/* filesytem								*/
#undef HAVE_DIRENT_H
/* dynamic linking of libraries						*/
#undef HAVE_DLFCN_H
#undef HAVE_LINK_H
#undef HAVE_MACH_O_DYLD_H
/* POSIX signals							*/
#undef HAVE_SIGPROCMASK
/* isatty() checks whether a file is connected to a			*/
#undef HAVE_ISATTY

/* what characters are used to mark beginning of new line		*/
#undef ECL_NEWLINE_IS_CRLF
#undef ECL_NEWLINE_IS_LFCR

/*
 * PARAMETERS:
 */

/*
 * Memory limits for the old garbage collector.
 */
#define	LISP_PAGESIZE	2048	/* Page size in bytes			*/
#define MAXPAGE	16384		/* Maximum Memory Size			*/

/*
 * The lisp environment has several stacks. These are their limits:
 */
#define BDSSIZE	2048		/* Size of Binding Stack		*/
#define	BDSGETA	16		/* Safety zone of BDS			*/
#define FRSSIZE	1024		/* Size of Frame Stack			*/
#define	FRSGETA	16		/* Safety zone of FRS			*/
#ifdef THREADS
#define	CSSIZE	7500		/* Size of C Stack of each thread	*/
#define	CSGETA	500
#else
#define	CSSIZE	20000		/* Size of C Stack			*/
#define	CSGETA	4000
#endif

/* We reserve these many bytes for computation with bignums registers	*/
#define BIGNUM_REGISTER_SIZE 16

/*
 * Macros that depend on these system features.
 */
#if defined(sparc) || defined(i386) || defined(mips)
#  define	stack_align(n)	(((n) + 0x7) & ~0x7)
#else
#  define	stack_align(n)	(((n) + 03) & ~03)
#endif

#undef FILE_CNT
#if 2 == 1
#  define FILE_CNT(fp)	((fp)->_IO_read_end - (fp)->_IO_read_ptr)
#endif
#if 2 == 2
#  define FILE_CNT(fp)	((fp)->_r)
#endif
#if 2 == 3
#  define FILE_CNT(fp)	((fp)->_cnt)
#endif

#if defined(MSDOS) || defined(cygwin) || defined(mingw32)
#  define IS_DIR_SEPARATOR(x) ((x=='/')||(x=='\\'))
#  ifdef MSDOS
#    define DIR_SEPARATOR	'\\'
#  else
#    define DIR_SEPARATOR	'/'
#  endif
#  define PATH_SEPARATOR	';'
#else
#  define IS_DIR_SEPARATOR(x) (x=='/')
#  define DIR_SEPARATOR	'/'
#  define PATH_SEPARATOR	':'
#endif /* MSDOS */

#define ECL_ARCHITECTURE "AMD64"
