mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 14:50:19 +02:00
* __scm.h: Fix a bunch of macros that were missing do-while(0)
sandwiches. * debug.c, eval.c: Fix buggy uses of SCM_ALLOW_INTS (missing semicolon) exposed by the above change.
This commit is contained in:
parent
155265386a
commit
bfc69694be
3 changed files with 16 additions and 16 deletions
|
@ -254,10 +254,10 @@ typedef long SCM_STACKITEM;
|
||||||
extern unsigned int scm_async_clock;
|
extern unsigned int scm_async_clock;
|
||||||
|
|
||||||
#define SCM_ASYNC_TICK \
|
#define SCM_ASYNC_TICK \
|
||||||
{ \
|
do { \
|
||||||
if (0 == --scm_async_clock) \
|
if (0 == --scm_async_clock) \
|
||||||
scm_async_click (); \
|
scm_async_click (); \
|
||||||
} \
|
} while(0)
|
||||||
|
|
||||||
#ifdef SCM_CAREFUL_INTS
|
#ifdef SCM_CAREFUL_INTS
|
||||||
#define SCM_CHECK_NOT_DISABLED \
|
#define SCM_CHECK_NOT_DISABLED \
|
||||||
|
@ -296,25 +296,25 @@ extern unsigned int scm_async_clock;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SCM_DEFER_INTS \
|
#define SCM_DEFER_INTS \
|
||||||
{ \
|
do { \
|
||||||
SCM_FENCE; \
|
SCM_FENCE; \
|
||||||
SCM_CHECK_NOT_DISABLED; \
|
SCM_CHECK_NOT_DISABLED; \
|
||||||
SCM_THREAD_DEFER; \
|
SCM_THREAD_DEFER; \
|
||||||
SCM_FENCE; \
|
SCM_FENCE; \
|
||||||
scm_ints_disabled = 1; \
|
scm_ints_disabled = 1; \
|
||||||
SCM_FENCE; \
|
SCM_FENCE; \
|
||||||
} \
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
#define SCM_ALLOW_INTS_ONLY \
|
#define SCM_ALLOW_INTS_ONLY \
|
||||||
{ \
|
do { \
|
||||||
SCM_THREAD_ALLOW; \
|
SCM_THREAD_ALLOW; \
|
||||||
scm_ints_disabled = 0; \
|
scm_ints_disabled = 0; \
|
||||||
} \
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
#define SCM_ALLOW_INTS \
|
#define SCM_ALLOW_INTS \
|
||||||
{ \
|
do { \
|
||||||
SCM_FENCE; \
|
SCM_FENCE; \
|
||||||
SCM_CHECK_NOT_ENABLED; \
|
SCM_CHECK_NOT_ENABLED; \
|
||||||
SCM_THREAD_SWITCHING_CODE; \
|
SCM_THREAD_SWITCHING_CODE; \
|
||||||
|
@ -324,20 +324,20 @@ extern unsigned int scm_async_clock;
|
||||||
SCM_THREAD_ALLOW; \
|
SCM_THREAD_ALLOW; \
|
||||||
SCM_ASYNC_TICK; \
|
SCM_ASYNC_TICK; \
|
||||||
SCM_FENCE; \
|
SCM_FENCE; \
|
||||||
} \
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
#define SCM_REDEFER_INTS \
|
#define SCM_REDEFER_INTS \
|
||||||
{ \
|
do { \
|
||||||
SCM_FENCE; \
|
SCM_FENCE; \
|
||||||
SCM_THREAD_REDEFER; \
|
SCM_THREAD_REDEFER; \
|
||||||
++scm_ints_disabled; \
|
++scm_ints_disabled; \
|
||||||
SCM_FENCE; \
|
SCM_FENCE; \
|
||||||
} \
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
#define SCM_REALLOW_INTS \
|
#define SCM_REALLOW_INTS \
|
||||||
{ \
|
do { \
|
||||||
SCM_FENCE; \
|
SCM_FENCE; \
|
||||||
SCM_THREAD_REALLOW_1; \
|
SCM_THREAD_REALLOW_1; \
|
||||||
SCM_THREAD_SWITCHING_CODE; \
|
SCM_THREAD_SWITCHING_CODE; \
|
||||||
|
@ -349,14 +349,14 @@ extern unsigned int scm_async_clock;
|
||||||
SCM_ASYNC_TICK; \
|
SCM_ASYNC_TICK; \
|
||||||
} \
|
} \
|
||||||
SCM_FENCE; \
|
SCM_FENCE; \
|
||||||
} \
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
#define SCM_TICK \
|
#define SCM_TICK \
|
||||||
{ \
|
do { \
|
||||||
SCM_DEFER_INTS; \
|
SCM_DEFER_INTS; \
|
||||||
SCM_ALLOW_INTS; \
|
SCM_ALLOW_INTS; \
|
||||||
} \
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ scm_debug_options (setting)
|
||||||
SCM_RESET_DEBUG_MODE;
|
SCM_RESET_DEBUG_MODE;
|
||||||
scm_stack_checking_enabled_p = SCM_STACK_CHECKING_P;
|
scm_stack_checking_enabled_p = SCM_STACK_CHECKING_P;
|
||||||
scm_debug_eframe_size = 2 * SCM_N_FRAMES;
|
scm_debug_eframe_size = 2 * SCM_N_FRAMES;
|
||||||
SCM_ALLOW_INTS
|
SCM_ALLOW_INTS;
|
||||||
return ans;
|
return ans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1796,7 +1796,7 @@ scm_evaluator_traps (setting)
|
||||||
SCM_N_EVALUATOR_TRAPS,
|
SCM_N_EVALUATOR_TRAPS,
|
||||||
s_evaluator_traps);
|
s_evaluator_traps);
|
||||||
SCM_RESET_DEBUG_MODE;
|
SCM_RESET_DEBUG_MODE;
|
||||||
SCM_ALLOW_INTS
|
SCM_ALLOW_INTS;
|
||||||
return ans;
|
return ans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue