guile-commits
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]