[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/10] cpp hygiene in the vm
From: |
Andy Wingo |
Subject: |
[PATCH 08/10] cpp hygiene in the vm |
Date: |
Thu, 23 May 2013 15:31:01 +0200 |
* libguile/vm-engine.c:
* libguile/vm-i-scheme.c:
* libguile/vm-i-system.c: CPP hygiene: the code that #defines, #undefs.
Makes things cleaner given the multiple inclusion dance we do.
---
libguile/vm-engine.c | 26 ++++++++++++++++++++++++++
libguile/vm-i-scheme.c | 24 ++++++++++++++++++------
libguile/vm-i-system.c | 3 +++
3 files changed, 47 insertions(+), 6 deletions(-)
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 1cd623d..4454632 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -433,8 +433,34 @@ VM_NAME (SCM vm, SCM program, SCM *argv, int nargs)
abort (); /* never reached */
}
+#undef ALIGNED_P
+#undef CACHE_REGISTER
+#undef CHECK_OVERFLOW
+#undef FREE_VARIABLE_REF
+#undef FUNC2
+#undef INIT
+#undef INUM_MAX
+#undef INUM_MIN
+#undef jump_table
+#undef LOCAL_REF
+#undef LOCAL_SET
+#undef NEXT
+#undef NEXT_JUMP
+#undef REL
+#undef RETURN
+#undef RETURN_ONE_VALUE
+#undef RETURN_VALUE_LIST
#undef RUN_HOOK
#undef RUN_HOOK1
+#undef SYNC_ALL
+#undef SYNC_BEFORE_GC
+#undef SYNC_IP
+#undef SYNC_REGISTER
+#undef VARIABLE_BOUNDP
+#undef VARIABLE_REF
+#undef VARIABLE_SET
+#undef VM_DEFINE_OP
+#undef VM_INSTRUCTION_TO_LABEL
#undef VM_USE_HOOKS
/*
diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c
index c12c42b..ef3d02b 100644
--- a/libguile/vm-i-scheme.c
+++ b/libguile/vm-i-scheme.c
@@ -176,7 +176,6 @@ VM_DEFINE_INSTRUCTION (146, set_cdr, "set-cdr!", 0, 2, 0)
* Numeric relational tests
*/
-#undef REL
#define REL(crel,srel) \
{ \
ARGS2 (x, y); \
@@ -212,18 +211,17 @@ VM_DEFINE_FUNCTION (151, ge, "ge?", 2)
REL (>=, scm_geq_p);
}
+#undef REL
+
/*
* Numeric functions
*/
/* The maximum/minimum tagged integers. */
-#undef INUM_MAX
-#undef INUM_MIN
#define INUM_MAX (INTPTR_MAX - 1)
#define INUM_MIN (INTPTR_MIN + scm_tc2_int)
-#undef FUNC2
#define FUNC2(CFUNC,SFUNC) \
{ \
ARGS2 (x, y); \
@@ -357,8 +355,11 @@ VM_DEFINE_FUNCTION (155, sub1, "sub1", 1)
RETURN (scm_difference (x, SCM_I_MAKINUM (1)));
}
-# undef ASM_ADD
-# undef ASM_SUB
+#undef ASM_ADD
+#undef ASM_SUB
+#undef FUNC2
+#undef INUM_MAX
+#undef INUM_MIN
VM_DEFINE_FUNCTION (156, mul, "mul", 2)
{
@@ -992,6 +993,17 @@ BV_FLOAT_SET (f64, ieee_double, double, 8)
#undef BV_INT_SET
#undef BV_FLOAT_SET
+#undef ALIGNED_P
+#undef VM_VALIDATE_BYTEVECTOR
+
+#undef VM_VALIDATE_STRUCT
+#undef VM_VALIDATE_CONS
+
+#undef ARGS1
+#undef ARGS2
+#undef ARGS3
+#undef RETURN
+
/*
(defun renumber-ops ()
"start from top of buffer and renumber 'VM_DEFINE_FOO (\n' sequences"
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
index f649822..9b24c92 100644
--- a/libguile/vm-i-system.c
+++ b/libguile/vm-i-system.c
@@ -538,6 +538,9 @@ VM_DEFINE_INSTRUCTION (42, br_if_not_nil, "br-if-not-nil",
3, 0, 0)
POP (x);
BR (!scm_is_lisp_false (x));
}
+
+#undef BR
+
/*
* Subprogram call
--
1.7.10.4
- Add RTL VM, Andy Wingo, 2013/05/23
- [PATCH 01/10] inline vm-engine.h into vm-engine.c, Andy Wingo, 2013/05/23
- [PATCH 03/10] minor vm-engine cleanups, Andy Wingo, 2013/05/23
- [PATCH 02/10] remove CONS macro in VM; use scm_cons instead, Andy Wingo, 2013/05/23
- [PATCH 04/10] remove some configurability in vm-engine, Andy Wingo, 2013/05/23
- [PATCH 05/10] vm-engine: remove register assignments, Andy Wingo, 2013/05/23
- [PATCH 06/10] Allow vm_engine caller to pass arguments on the stack., Andy Wingo, 2013/05/23
- [PATCH 08/10] cpp hygiene in the vm,
Andy Wingo <=
- [PATCH 07/10] pop-continuation abort-continuation hooks pass return vals directly, Andy Wingo, 2013/05/23
- [PATCH 09/10] refactor to resolve_variable, Andy Wingo, 2013/05/23
- [PATCH 10/10] add new rtl vm, Andy Wingo, 2013/05/23