summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libguile/fluids.c8
-rw-r--r--libguile/fluids.h12
2 files changed, 9 insertions, 11 deletions
diff --git a/libguile/fluids.c b/libguile/fluids.c
index c9ea68b8f..d49305397 100644
--- a/libguile/fluids.c
+++ b/libguile/fluids.c
@@ -65,11 +65,11 @@ static size_t allocated_fluids_len = 0;
static size_t allocated_fluids_num = 0;
static char *allocated_fluids = NULL;
-#define IS_FLUID(x) (!SCM_IMP (x) && SCM_TYP7 (x) == scm_tc7_fluid)
-#define FLUID_NUM(x) ((size_t)SCM_CELL_WORD_1(x))
+#define IS_FLUID(x) SCM_I_FLUID_P (x)
+#define FLUID_NUM(x) SCM_I_FLUID_NUM (x)
-#define IS_DYNAMIC_STATE(x) (!SCM_IMP (x) && SCM_TYP7 (x) == scm_tc7_dynamic_state)
-#define DYNAMIC_STATE_FLUIDS(x) SCM_PACK (SCM_CELL_WORD_1 (x))
+#define IS_DYNAMIC_STATE(x) SCM_I_DYNAMIC_STATE_P (x)
+#define DYNAMIC_STATE_FLUIDS(x) SCM_I_DYNAMIC_STATE_FLUIDS (x)
#define SET_DYNAMIC_STATE_FLUIDS(x, y) SCM_SET_CELL_WORD_1 ((x), (SCM_UNPACK (y)))
diff --git a/libguile/fluids.h b/libguile/fluids.h
index 7aefd478f..0d61fd2e4 100644
--- a/libguile/fluids.h
+++ b/libguile/fluids.h
@@ -54,13 +54,8 @@
grow.
*/
-/* The fastest way to acces/modify the value of a fluid. These macros
- do no error checking at all. The first argument is the index
- number of the fluid, obtained via SCM_FLUID_NUM, not the fluid
- itself. You must make sure that the fluid remains protected as
- long you use its number since numbers of unused fluids are reused
- eventually.
-*/
+#define SCM_I_FLUID_P(x) (!SCM_IMP (x) && SCM_TYP7 (x) == scm_tc7_fluid)
+#define SCM_I_FLUID_NUM(x) ((size_t)SCM_CELL_WORD_1(x))
SCM_API SCM scm_make_fluid (void);
SCM_API int scm_is_fluid (SCM obj);
@@ -80,6 +75,9 @@ SCM_API SCM scm_with_fluid (SCM fluid, SCM val, SCM thunk);
SCM_API void scm_dynwind_fluid (SCM fluid, SCM value);
+#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))
+
SCM_API SCM scm_make_dynamic_state (SCM parent);
SCM_API SCM scm_dynamic_state_p (SCM obj);
SCM_API int scm_is_dynamic_state (SCM obj);