5 /* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this software; see the file COPYING. If not, write to
19 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21 * As a special exception, the Free Software Foundation gives permission
22 * for additional uses of the text contained in its release of GUILE.
24 * The exception is that, if you link the GUILE library with other files
25 * to produce an executable, this does not by itself cause the
26 * resulting executable to be covered by the GNU General Public License.
27 * Your use of that executable is in no way restricted on account of
28 * linking the GUILE library code into it.
30 * This exception does not however invalidate any other reasons why
31 * the executable file might be covered by the GNU General Public License.
33 * This exception applies only to the code released by the
34 * Free Software Foundation under the name GUILE. If you copy
35 * code from other Free Software Foundation releases into a copy of
36 * GUILE, as the General Public License permits, the exception does
37 * not apply to the code that you add in this way. To avoid misleading
38 * anyone as to the status of such modified files, you must delete
39 * this exception notice from them.
41 * If you write modifications of your own for GUILE, it is your choice
42 * whether to permit this exception to apply to your modifications.
43 * If you do not wish that, delete this exception notice.
46 /* {Supported Options}
48 * These may be defined or undefined.
51 /* If the compile FLAG `CAUTIOUS' is #defined then the number of
52 * arguments is always checked for application of closures. If the
53 * compile FLAG `RECKLESS' is #defined then they are not checked.
54 * Otherwise, number of argument checks for closures are made only when
55 * the function position (whose value is the closure) of a combination is
56 * not an ILOC or GLOC. When the function position of a combination is a
57 * symbol it will be checked only the first time it is evaluated because
58 * it will then be replaced with an ILOC or GLOC.
63 /* After looking up a local for the first time, rewrite the
64 * code graph, caching its position.
66 #define MEMOIZE_LOCALS
68 /* All the number support there is.
73 /* GC should relinquish empty cons-pair arenas.
75 #define GC_FREE_SEGMENTS
77 /* Provide a scheme-accessible count-down timer that
78 * generates a pseudo-interrupt.
83 /* Use engineering notation when converting numbers strings?
87 /* Include support for uniform arrays?
89 * Possibly some of the initialization code depends on this
90 * being defined, but that is a bug and should be fixed.
94 #undef SCM_CAREFUL_INTS
96 /* {Unsupported Options}
98 * These must be defined.
107 /* Random options (net yet supported or in final form). */
109 #undef DEBUG_EXTENSIONS
110 #undef READER_EXTENSIONS
111 #undef SCM_STACK_LIMIT 20000
112 #undef NO_CEVAL_STACK_CHECK
115 /* Some auto-generated .h files contain unused prototypes
116 * that need these typedefs.
118 typedef long long_long
;
119 typedef unsigned long ulong_long
;
123 /* What did the configure script discover about the outside world? */
124 #include <scmconfig.h>
127 /* Write prototype declarations like this:
128 int foo PROTO(int a, int b);
129 At definitions, use K&R style declarations, but make sure there's a
130 declarative prototype (as above) in scope. This will give you
131 argument type checking, when available, and be harmless otherwise. */
135 # define PROTO(x) (x)
142 * SCM_CHAR_SCM_CODE_LIMIT == UCHAR_MAX + 1
143 * SCM_MOST_POSITIVE_FIXNUM (LONG_MAX>>2)
144 * SCM_MOST_NEGATIVE_FIXNUM == SCM_SRS((long)LONG_MIN, 2)
150 # define SCM_CHAR_SCM_CODE_LIMIT (UCHAR_MAX+1L)
152 # define SCM_CHAR_SCM_CODE_LIMIT 256L
153 # endif /* def UCHAR_MAX */
154 # define SCM_MOST_POSITIVE_FIXNUM (LONG_MAX>>2)
155 # ifdef _UNICOS /* Stupid cray bug */
156 # define SCM_MOST_NEGATIVE_FIXNUM ((long)LONG_MIN/4)
158 # define SCM_MOST_NEGATIVE_FIXNUM SCM_SRS((long)LONG_MIN, 2)
161 # define SCM_CHAR_SCM_CODE_LIMIT 256L
162 # define SCM_MOST_POSITIVE_FIXNUM ((long)((unsigned long)~0L>>3))
164 # define SCM_MOST_NEGATIVE_FIXNUM (-SCM_MOST_POSITIVE_FIXNUM-1)
166 # define SCM_MOST_NEGATIVE_FIXNUM (-SCM_MOST_POSITIVE_FIXNUM)
167 # endif /* (0 != ~0) */
168 #endif /* def HAVE_LIMITS_H */
175 # ifndef CHEAP_CONTINUATIONS
176 typedef int jmp_buf[17];
177 extern int setjump(jmp_buf env
);
178 extern int longjump(jmp_buf env
, int ret
);
179 # define setjmp setjump
180 # define longjmp longjump
186 typedef int jmp_buf[112];
187 extern int setjump(jmp_buf env
);
188 extern int longjump(jmp_buf env
, int ret
);
189 # define setjmp setjump
190 # define longjmp longjump
191 # else /* ndef _CRAY1 */
193 # endif /* ndef _CRAY1 */
194 #endif /* ndef vms */
196 /* James Clark came up with this neat one instruction fix for
197 * continuations on the SPARC. It flushes the register windows so
198 * that all the state of the process is contained in the stack.
202 # define SCM_FLUSH_REGISTER_WINDOWS asm("ta 3")
204 # define SCM_FLUSH_REGISTER_WINDOWS /* empty */
207 /* If stack is not longword aligned then
210 /* #define SHORT_ALIGN */
222 typedef short SCM_STACKITEM
;
224 typedef long SCM_STACKITEM
;
228 extern unsigned int scm_async_clock
;
229 #define SCM_ASYNC_TICK if (0 == --scm_async_clock) scm_async_click ()
231 #ifdef SCM_CAREFUL_INTS
232 #define SCM_CHECK_NOT_DISABLED \
233 if (scm_ints_disabled) \
234 fputs("ints already disabled\n", stderr); \
236 #define SCM_CHECK_NOT_ENABLED \
237 if (!scm_ints_disabled) \
238 fputs("ints already enabled\n", stderr); \
241 #define SCM_CHECK_NOT_DISABLED
242 #define SCM_CHECK_NOT_ENABLED
246 #define SCM_DEFER_INTS \
248 SCM_CHECK_NOT_DISABLED; \
249 scm_ints_disabled = 1; \
253 #define SCM_ALLOW_INTS_ONLY \
255 scm_ints_disabled = 0; \
259 #define SCM_ALLOW_INTS \
261 SCM_CHECK_NOT_ENABLED; \
262 scm_ints_disabled = 0; \
267 #define SCM_REDEFER_INTS \
269 ++scm_ints_disabled; \
273 #define SCM_REALLOW_INTS \
275 --scm_ints_disabled; \
276 if (!scm_ints_disabled) \
290 #define SCM_ASSERT(_cond, _arg, _pos, _subr)
291 #define SCM_ASRTGO(_cond, _label)
293 #define SCM_ASSERT(_cond, _arg, _pos, _subr) \
295 scm_wta(_arg, (char *)(_pos), _subr)
296 #define SCM_ASRTGO(_cond, _label) \
301 #define SCM_SYSERROR(_subr) \
302 scm_everr (SCM_UNDEFINED, SCM_EOL, SCM_UNDEFINED, \
303 strerror (errno), _subr)
306 scm_throw (system_error_sym, \
307 scm_listify (scm_makfrom0str (strerror (errno)), \
308 scm_makfrom0str (_subr), \
312 # define SCM_SYSMISSING(_subr) \
313 scm_everr (SCM_UNDEFINED, SCM_EOL, SCM_UNDEFINED, \
314 strerror (ENOSYS), _subr)
316 # define SCM_SYSMISSING(_subr) \
317 scm_everr (SCM_UNDEFINED, SCM_EOL, SCM_UNDEFINED, \
318 "missing function", _subr)
328 #define SCM_ARGERR(X) ((X) < SCM_WNA \
330 : "wrong type argument")
332 /* Following must match entry indexes in scm_errmsgs[].
333 * Also, SCM_WNA must follow the last SCM_ARGn in sequence.
336 #define SCM_OVSCM_FLOW 9
337 #define SCM_OUTOFRANGE 10
338 #define SCM_NALLOC 11
339 #define SCM_STACK_SCM_OVSCM_FLOW 12
343 /* (...still matching scm_errmsgs) These
344 * are signals. Signals may become errors
345 * but are distinguished because they first
346 * try to invoke a handler that can resume
347 * the interrupted routine.
349 #define SCM_HUP_SIGNAL 14
350 #define SCM_INT_SIGNAL 15
351 #define SCM_FPE_SIGNAL 16
352 #define SCM_BUS_SIGNAL 17
353 #define SCM_SEGV_SIGNAL 18
354 #define SCM_ALRM_SIGNAL 19
355 #define SCM_GC_SIGNAL 20
356 #define SCM_TICK_SIGNAL 21
358 #define SCM_SIG_ORD(X) ((X) - SCM_HUP_SIGNAL)
359 #define SCM_ORD_SIG(X) ((X) + SCM_HUP_SIGNAL)
360 #define SCM_NUM_SIGS (SCM_SIG_ORD (SCM_TICK_SIGNAL) + 1)
370 extern struct errdesc scm_errmsgs
[];
374 /* SCM_EXIT_SUCCESS is the default code to return from SCM if no errors
375 * were encountered. SCM_EXIT_FAILURE is the default code to return from
376 * SCM if errors were encountered. The return code can be explicitly
377 * specified in a SCM program with (scm_quit <n>).
380 #ifndef SCM_EXIT_SUCCESS
382 #define SCM_EXIT_SUCCESS 1
384 #define SCM_EXIT_SUCCESS 0
386 #endif /* ndef SCM_EXIT_SUCCESS */
387 #ifndef SCM_EXIT_FAILURE
389 #define SCM_EXIT_FAILURE 2
391 #define SCM_EXIT_FAILURE 1
393 #endif /* ndef SCM_EXIT_FAILURE */