1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-21 20:20:24 +02:00

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.
This commit is contained in:
Andy Wingo 2010-07-17 12:10:52 +02:00
parent 0f3a70cfa8
commit 6f8d7b12bb
3 changed files with 8 additions and 4 deletions

View file

@ -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; 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 FLUID_NUM(x) SCM_I_FLUID_NUM (x)
#define IS_DYNAMIC_STATE(x) SCM_I_DYNAMIC_STATE_P (x) #define IS_DYNAMIC_STATE(x) SCM_I_DYNAMIC_STATE_P (x)

View file

@ -54,8 +54,10 @@
grow. 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)) #define SCM_I_FLUID_NUM(x) ((size_t)SCM_CELL_WORD_1(x))
#endif
SCM_API SCM scm_make_fluid (void); SCM_API SCM scm_make_fluid (void);
SCM_API int scm_is_fluid (SCM obj); 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); 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_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)) #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_make_dynamic_state (SCM parent);
SCM_API SCM scm_dynamic_state_p (SCM obj); SCM_API SCM scm_dynamic_state_p (SCM obj);

View file

@ -1594,7 +1594,7 @@ VM_DEFINE_INSTRUCTION (92, fluid_ref, "fluid-ref", 0, 1, 1)
CHECK_UNDERFLOW (); CHECK_UNDERFLOW ();
fluids = SCM_I_DYNAMIC_STATE_FLUIDS (dynstate); 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))) || ((num = SCM_I_FLUID_NUM (*sp)) >= SCM_SIMPLE_VECTOR_LENGTH (fluids)))
{ {
/* Punt dynstate expansion and error handling to the C proc. */ /* 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 (val);
POP (fluid); POP (fluid);
fluids = SCM_I_DYNAMIC_STATE_FLUIDS (dynstate); 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))) || ((num = SCM_I_FLUID_NUM (fluid)) >= SCM_SIMPLE_VECTOR_LENGTH (fluids)))
{ {
/* Punt dynstate expansion and error handling to the C proc. */ /* Punt dynstate expansion and error handling to the C proc. */