[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 46/86: Move symbol snarfers to symbols.h
From: |
Andy Wingo |
Subject: |
[Guile-commits] 46/86: Move symbol snarfers to symbols.h |
Date: |
Wed, 20 Jun 2018 14:09:37 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit c376e99ff9e73da10dc55e4ae9acf703fded12bf
Author: Andy Wingo <address@hidden>
Date: Wed Jun 20 08:42:33 2018 +0200
Move symbol snarfers to symbols.h
* libguile/snarf.h:
* libguile/symbols.h (SCM_SYMBOL, SCM_GLOBAL_SYMBOL): Move here.
---
libguile/snarf.h | 30 ------------------------------
libguile/symbols.h | 35 ++++++++++++++++++++++++++++++++++-
2 files changed, 34 insertions(+), 31 deletions(-)
diff --git a/libguile/snarf.h b/libguile/snarf.h
index 3ef17c1..a81f712 100644
--- a/libguile/snarf.h
+++ b/libguile/snarf.h
@@ -152,36 +152,6 @@ scm_c_define_gsubr_with_generic (RANAME, REQ, OPT, VAR, \
(SCM_FUNC_CAST_ARBITRARY_ARGS) CFN, &GF) \
)
-#ifdef SCM_SUPPORT_STATIC_ALLOCATION
-
-# define SCM_SYMBOL(c_name, scheme_name) \
-SCM_SNARF_HERE(
\
- SCM_IMMUTABLE_STRING (scm_i_paste (c_name, _string), scheme_name); \
- static SCM c_name) \
-SCM_SNARF_INIT(
\
- c_name = scm_string_to_symbol (scm_i_paste (c_name, _string))
\
-)
-
-# define SCM_GLOBAL_SYMBOL(c_name, scheme_name)
\
-SCM_SNARF_HERE(
\
- SCM_IMMUTABLE_STRING (scm_i_paste (c_name, _string), scheme_name); \
- SCM c_name) \
-SCM_SNARF_INIT(
\
- c_name = scm_string_to_symbol (scm_i_paste (c_name, _string))
\
-)
-
-#else /* !SCM_SUPPORT_STATIC_ALLOCATION */
-
-# define SCM_SYMBOL(c_name, scheme_name) \
-SCM_SNARF_HERE(static SCM c_name) \
-SCM_SNARF_INIT(c_name = scm_from_utf8_symbol (scheme_name))
-
-# define SCM_GLOBAL_SYMBOL(c_name, scheme_name)
\
-SCM_SNARF_HERE(SCM c_name) \
-SCM_SNARF_INIT(c_name = scm_from_utf8_symbol (scheme_name))
-
-#endif /* !SCM_SUPPORT_STATIC_ALLOCATION */
-
#define SCM_KEYWORD(c_name, scheme_name) \
SCM_SNARF_HERE(static SCM c_name) \
SCM_SNARF_INIT(c_name = scm_from_locale_keyword (scheme_name))
diff --git a/libguile/symbols.h b/libguile/symbols.h
index 00fb2c4..cf1d09e 100644
--- a/libguile/symbols.h
+++ b/libguile/symbols.h
@@ -26,8 +26,8 @@
#include "libguile/__scm.h"
#include <libguile/error.h>
-
#include <libguile/gc.h>
+#include <libguile/snarf.h>
@@ -44,6 +44,39 @@
SCM_ASSERT_TYPE (scm_is_symbol (str), str, pos, FUNC_NAME, "symbol"); \
} while (0)
+
+
+
+#ifdef SCM_SUPPORT_STATIC_ALLOCATION
+
+# define SCM_SYMBOL(c_name, scheme_name) \
+SCM_SNARF_HERE(
\
+ SCM_IMMUTABLE_STRING (scm_i_paste (c_name, _string), scheme_name); \
+ static SCM c_name) \
+SCM_SNARF_INIT(
\
+ c_name = scm_string_to_symbol (scm_i_paste (c_name, _string))
\
+)
+
+# define SCM_GLOBAL_SYMBOL(c_name, scheme_name)
\
+SCM_SNARF_HERE(
\
+ SCM_IMMUTABLE_STRING (scm_i_paste (c_name, _string), scheme_name); \
+ SCM c_name) \
+SCM_SNARF_INIT(
\
+ c_name = scm_string_to_symbol (scm_i_paste (c_name, _string))
\
+)
+
+#else /* !SCM_SUPPORT_STATIC_ALLOCATION */
+
+# define SCM_SYMBOL(c_name, scheme_name) \
+SCM_SNARF_HERE(static SCM c_name) \
+SCM_SNARF_INIT(c_name = scm_from_utf8_symbol (scheme_name))
+
+# define SCM_GLOBAL_SYMBOL(c_name, scheme_name)
\
+SCM_SNARF_HERE(SCM c_name) \
+SCM_SNARF_INIT(c_name = scm_from_utf8_symbol (scheme_name))
+
+#endif /* !SCM_SUPPORT_STATIC_ALLOCATION */
+
/* Older spellings; don't use in new code.
- [Guile-commits] 20/86: Move pair, null, nil, and boolean validators out of validate.h, (continued)
- [Guile-commits] 20/86: Move pair, null, nil, and boolean validators out of validate.h, Andy Wingo, 2018/06/20
- [Guile-commits] 29/86: Move gsubr.h include to snarf.h, Andy Wingo, 2018/06/20
- [Guile-commits] 33/86: Move array-handle.h include out from inline.h, Andy Wingo, 2018/06/20
- [Guile-commits] 30/86: Devolve procs.h include from _scm.h., Andy Wingo, 2018/06/20
- [Guile-commits] 36/86: Remove threads.h include from ports.h, Andy Wingo, 2018/06/20
- [Guile-commits] 28/86: Devolve gc.h, Andy Wingo, 2018/06/20
- [Guile-commits] 35/86: Move struct.h include out of ports.h, Andy Wingo, 2018/06/20
- [Guile-commits] 34/86: Remove bytevectors.h include form ports.h, Andy Wingo, 2018/06/20
- [Guile-commits] 43/86: Remove error.h from inline.h, Andy Wingo, 2018/06/20
- [Guile-commits] 45/86: Move scm_tc7_pointer snarfer out to foreign.h, Andy Wingo, 2018/06/20
- [Guile-commits] 46/86: Move symbol snarfers to symbols.h,
Andy Wingo <=
- [Guile-commits] 41/86: Remove ports.h from inline.h, Andy Wingo, 2018/06/20
- [Guile-commits] 21/86: More validate.h devolution, Andy Wingo, 2018/06/20
- [Guile-commits] 40/86: Remove <unistd.h> from ports.h, Andy Wingo, 2018/06/20
- [Guile-commits] 37/86: Devolve vectors.h include from ports.h, Andy Wingo, 2018/06/20
- [Guile-commits] 38/86: Remove <string.h> include from ports.h., Andy Wingo, 2018/06/20
- [Guile-commits] 42/86: Remove numbers.h from inline.h, Andy Wingo, 2018/06/20
- [Guile-commits] 48/86: Deprecate SCM_STATIC_DOUBLE_CELL snarf macro, Andy Wingo, 2018/06/20
- [Guile-commits] 51/86: Devolve variable snarfers, Andy Wingo, 2018/06/20
- [Guile-commits] 50/86: Devolve keyword-snarfing macros, Andy Wingo, 2018/06/20
- [Guile-commits] 49/86: Move string-related snarfers to strings.h, Andy Wingo, 2018/06/20