wingo pushed a commit to branch wip-whippet
in repository guile.

commit 974550e335205b85b2cbc161f33851be9ed13658
Author: Andy Wingo <wi...@pobox.com>
AuthorDate: Mon Jun 30 14:36:53 2025 +0200

    Move "struct scm_syntax" definition to internal header
    
    * libguile/syntax.c:
    * libguile/syntax.h (scm_is_syntax, scm_to_syntax, scm_from_syntax):
    Move here.
---
 libguile/syntax.c | 29 -----------------------------
 libguile/syntax.h | 29 +++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/libguile/syntax.c b/libguile/syntax.c
index e86556fba..50db34824 100644
--- a/libguile/syntax.c
+++ b/libguile/syntax.c
@@ -40,35 +40,6 @@
 
 
 
-struct scm_syntax
-{
-  scm_t_bits tag;
-  SCM expr;
-  SCM wrap;
-  SCM module;
-  SCM source;
-};
-
-static int
-scm_is_syntax (SCM x)
-{
-  return SCM_HAS_TYP7 (x, scm_tc7_syntax);
-}
-
-static inline struct scm_syntax *
-scm_to_syntax (SCM x)
-{
-  if (!scm_is_syntax (x))
-    abort ();
-  return (struct scm_syntax *) SCM_UNPACK_POINTER (x);
-}
-
-static inline SCM
-scm_from_syntax (struct scm_syntax *stx)
-{
-  return SCM_PACK_POINTER (stx);
-}
-
 #define SCM_VALIDATE_SYNTAX(pos, scm) \
   SCM_I_MAKE_VALIDATE_MSG2 (pos, scm, scm_is_syntax, "syntax object")
 
diff --git a/libguile/syntax.h b/libguile/syntax.h
index 02da14808..2572ee4cb 100644
--- a/libguile/syntax.h
+++ b/libguile/syntax.h
@@ -22,6 +22,35 @@
 
 #include "libguile/scm.h"
 
+struct scm_syntax
+{
+  scm_t_bits tag;
+  SCM expr;
+  SCM wrap;
+  SCM module;
+  SCM source;
+};
+
+static int
+scm_is_syntax (SCM x)
+{
+  return SCM_HAS_TYP7 (x, scm_tc7_syntax);
+}
+
+static inline struct scm_syntax *
+scm_to_syntax (SCM x)
+{
+  if (!scm_is_syntax (x))
+    abort ();
+  return (struct scm_syntax *) SCM_UNPACK_POINTER (x);
+}
+
+static inline SCM
+scm_from_syntax (struct scm_syntax *stx)
+{
+  return SCM_PACK_POINTER (stx);
+}
+
 SCM_INTERNAL SCM scm_syntax_p (SCM obj);
 SCM_INTERNAL SCM scm_make_syntax (SCM exp, SCM wrap, SCM module, SCM source);
 SCM_INTERNAL SCM scm_syntax_expression (SCM obj);

Reply via email to