X-Git-Url: http://git.hcoop.net/bpt/guile.git/blobdiff_plain/52859adfb96a7e0d23d36856d1189688f16b1863..78bda5f34f4922db20553f0d16ef50c6b2bc57c9:/libguile/__scm.h diff --git a/libguile/__scm.h b/libguile/__scm.h index 86f345edd..52d175ead 100644 --- a/libguile/__scm.h +++ b/libguile/__scm.h @@ -95,12 +95,15 @@ /* {Unsupported Options} * - * These must be defined. + * These must be defined as given here. */ #define CCLO -#define SICP + +/* Guile Scheme supports the #f/() distinction; Guile Lisp won't. We + have horrible plans for their unification. */ +#undef SICP @@ -239,8 +242,32 @@ typedef long SCM_STACKITEM; #endif +#ifndef USE_THREADS +#define SCM_THREAD_DEFER +#define SCM_THREAD_ALLOW +#define SCM_THREAD_REDEFER +#define SCM_THREAD_REALLOW_1 +#define SCM_THREAD_REALLOW_2 +#define SCM_THREAD_SWITCHING_CODE +#endif + extern unsigned int scm_async_clock; -#define SCM_ASYNC_TICK if (0 == --scm_async_clock) scm_async_click () +#if 0 +#define SCM_ASYNC_TICK \ +{ \ + if (0 == --scm_async_clock) \ + scm_async_click (); \ +} \ + +#else +#define SCM_ASYNC_TICK \ +{ \ + if (0 == --scm_async_clock) \ + scm_async_click (); \ + SCM_THREAD_SWITCHING_CODE; \ +} \ + +#endif #ifdef SCM_CAREFUL_INTS #define SCM_CHECK_NOT_DISABLED \ @@ -260,12 +287,14 @@ extern unsigned int scm_async_clock; #define SCM_DEFER_INTS \ { \ SCM_CHECK_NOT_DISABLED; \ + SCM_THREAD_DEFER; \ scm_ints_disabled = 1; \ } \ #define SCM_ALLOW_INTS_ONLY \ { \ + SCM_THREAD_ALLOW; \ scm_ints_disabled = 0; \ } \ @@ -273,6 +302,7 @@ extern unsigned int scm_async_clock; #define SCM_ALLOW_INTS \ { \ SCM_CHECK_NOT_ENABLED; \ + SCM_THREAD_ALLOW; \ scm_ints_disabled = 0; \ SCM_ASYNC_TICK; \ } \ @@ -280,15 +310,20 @@ extern unsigned int scm_async_clock; #define SCM_REDEFER_INTS \ { \ + SCM_THREAD_REDEFER; \ ++scm_ints_disabled; \ } \ #define SCM_REALLOW_INTS \ { \ + SCM_THREAD_REALLOW_1; \ --scm_ints_disabled; \ if (!scm_ints_disabled) \ - SCM_ASYNC_TICK; \ + { \ + SCM_THREAD_REALLOW_2; \ + SCM_ASYNC_TICK; \ + } \ } \ @@ -312,9 +347,6 @@ extern unsigned int scm_async_clock; goto _label #endif -#define lgh_error(_key, _subr, _message, _args, _rest) \ - scm_error (_key, _subr, _message, _args, _rest) - #define SCM_ARGn 0 #define SCM_ARG1 1 #define SCM_ARG2 2 @@ -322,10 +354,11 @@ extern unsigned int scm_async_clock; #define SCM_ARG4 4 #define SCM_ARG5 5 #define SCM_ARG6 6 -#define SCM_ARG7 7 -#define SCM_ARGERR(X) ((X) < SCM_WNA \ +#define SCM_ARG7 7 + /* #define SCM_ARGERR(X) ((X) < SCM_WNA \ ? (char *)(X) \ : "wrong type argument") + */ /* Following must match entry indexes in scm_errmsgs[]. * Also, SCM_WNA must follow the last SCM_ARGn in sequence. @@ -334,8 +367,8 @@ extern unsigned int scm_async_clock; /* #define SCM_OVSCM_FLOW 9 */ #define SCM_OUTOFRANGE 10 #define SCM_NALLOC 11 -#define SCM_STACK_OVFLOW 12 -#define SCM_EXIT 13 + /* #define SCM_STACK_OVFLOW 12 */ + /* #define SCM_EXIT 13 */ /* (...still matching scm_errmsgs) These @@ -357,6 +390,7 @@ extern unsigned int scm_async_clock; #define SCM_ORD_SIG(X) ((X) + SCM_HUP_SIGNAL) #define SCM_NUM_SIGS (SCM_SIG_ORD (SCM_TICK_SIGNAL) + 1) +#if 0 struct errdesc { char *msg; @@ -366,6 +400,7 @@ struct errdesc extern struct errdesc scm_errmsgs[]; +#endif @@ -393,11 +428,5 @@ extern struct errdesc scm_errmsgs[]; -#ifdef __STDC__ - -#else /* STDC */ - -#endif /* STDC */ - #endif /* __SCMH */