From 6f8d7b12bbcc5be470bb6421bcd70d5806bce04b Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sat, 17 Jul 2010 12:10:52 +0200 Subject: SCM_I_FLUID_P -> SCM_FLUID_P * libguile/fluids.h (SCM_FLUID_P): Change from SCM_I_FLUID_P. (SCM_I_FLUID_NUM, SCM_I_DYNAMIC_STATE_P, SCM_I_DYNAMIC_STATE_FLUIDS): Wrap in BUILDING_LIBGUILE ifdef. --- libguile/fluids.c | 2 +- libguile/fluids.h | 6 +++++- libguile/vm-i-system.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libguile/fluids.c b/libguile/fluids.c index 9aa1eb2f0..636c78d89 100644 --- a/libguile/fluids.c +++ b/libguile/fluids.c @@ -44,7 +44,7 @@ static size_t allocated_fluids_len = 0; static scm_i_pthread_mutex_t fluid_admin_mutex = SCM_I_PTHREAD_MUTEX_INITIALIZER; -#define IS_FLUID(x) SCM_I_FLUID_P (x) +#define IS_FLUID(x) SCM_FLUID_P (x) #define FLUID_NUM(x) SCM_I_FLUID_NUM (x) #define IS_DYNAMIC_STATE(x) SCM_I_DYNAMIC_STATE_P (x) diff --git a/libguile/fluids.h b/libguile/fluids.h index aa01f2454..d8374149a 100644 --- a/libguile/fluids.h +++ b/libguile/fluids.h @@ -54,8 +54,10 @@ grow. */ -#define SCM_I_FLUID_P(x) (!SCM_IMP (x) && SCM_TYP7 (x) == scm_tc7_fluid) +#define SCM_FLUID_P(x) (!SCM_IMP (x) && SCM_TYP7 (x) == scm_tc7_fluid) +#ifdef BUILDING_LIBGUILE #define SCM_I_FLUID_NUM(x) ((size_t)SCM_CELL_WORD_1(x)) +#endif SCM_API SCM scm_make_fluid (void); SCM_API int scm_is_fluid (SCM obj); @@ -75,8 +77,10 @@ SCM_API SCM scm_with_fluid (SCM fluid, SCM val, SCM thunk); SCM_API void scm_dynwind_fluid (SCM fluid, SCM value); +#ifdef BUILDING_LIBGUILE #define SCM_I_DYNAMIC_STATE_P(x) (!SCM_IMP (x) && SCM_TYP7 (x) == scm_tc7_dynamic_state) #define SCM_I_DYNAMIC_STATE_FLUIDS(x) SCM_PACK (SCM_CELL_WORD_1 (x)) +#endif SCM_API SCM scm_make_dynamic_state (SCM parent); SCM_API SCM scm_dynamic_state_p (SCM obj); diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index 11f8ae0d8..3af63082a 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -1594,7 +1594,7 @@ VM_DEFINE_INSTRUCTION (92, fluid_ref, "fluid-ref", 0, 1, 1) CHECK_UNDERFLOW (); fluids = SCM_I_DYNAMIC_STATE_FLUIDS (dynstate); - if (SCM_UNLIKELY (!SCM_I_FLUID_P (*sp)) + if (SCM_UNLIKELY (!SCM_FLUID_P (*sp)) || ((num = SCM_I_FLUID_NUM (*sp)) >= SCM_SIMPLE_VECTOR_LENGTH (fluids))) { /* Punt dynstate expansion and error handling to the C proc. */ @@ -1615,7 +1615,7 @@ VM_DEFINE_INSTRUCTION (93, fluid_set, "fluid-set", 0, 2, 0) POP (val); POP (fluid); fluids = SCM_I_DYNAMIC_STATE_FLUIDS (dynstate); - if (SCM_UNLIKELY (!SCM_I_FLUID_P (fluid)) + if (SCM_UNLIKELY (!SCM_FLUID_P (fluid)) || ((num = SCM_I_FLUID_NUM (fluid)) >= SCM_SIMPLE_VECTOR_LENGTH (fluids))) { /* Punt dynstate expansion and error handling to the C proc. */ -- cgit v1.2.1