1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-08 10:32:27 +02:00

frames, values: BUILDING_LIBGUILE-guarded defs to internal headers

I was writing the trace function, which is included by Whippet, which
doesn't have the BUILDING_LIBGUILE define.  It is just as fine to put
these in private headers; better, even.

* libguile/frames-internal.h:
* libguile/values-internal.h: New files.
* libguile/Makefile.am (noinst_HEADERS): Add new files.
* libguile/backtrace.c:
* libguile/continuations.c:
* libguile/control.c:
* libguile/eval.c:
* libguile/frames.c:
* libguile/frames.h:
* libguile/gsubr.c:
* libguile/init.c:
* libguile/intrinsics.c:
* libguile/numbers.c:
* libguile/print.c:
* libguile/smob.c:
* libguile/smob.h:
* libguile/stacks.c:
* libguile/stacks.h:
* libguile/values.c:
* libguile/values.h:
* libguile/vm.c: Include new files.
This commit is contained in:
Andy Wingo 2025-07-01 10:43:14 +02:00
parent 65a265adea
commit 6a32628e18
21 changed files with 213 additions and 148 deletions

View file

@ -30,50 +30,13 @@ scm_is_values (SCM x)
return SCM_HAS_TYP7 (x, scm_tc7_values);
}
#ifdef BUILDING_LIBGUILE
struct scm_values
{
scm_t_bits tag_and_count;
SCM values[];
};
static inline struct scm_values*
scm_to_values (SCM x)
{
if (!scm_is_values (x))
abort ();
return (struct scm_values*) SCM_UNPACK_POINTER (x);
}
static inline SCM
scm_from_values (struct scm_values *values)
{
return SCM_PACK_POINTER (values);
}
static inline size_t
scm_values_count (struct scm_values *x)
{
return x->tag_and_count >> 8;
}
static inline SCM
scm_values_ref (struct scm_values *values, size_t n)
{
return values->values[n];
}
#endif
#define SCM_VALUESP(x) (scm_is_values (x))
SCM_INTERNAL void scm_values_extract_2 (SCM obj, SCM *p1, SCM *p2);
SCM_API SCM scm_values (SCM args);
SCM_API SCM scm_c_values (SCM *base, size_t n);
SCM_API SCM scm_values_2 (SCM a, SCM b);
SCM_API SCM scm_values_3 (SCM a, SCM b, SCM c);
SCM_API size_t scm_c_nvalues (SCM obj);
SCM_API SCM scm_c_value_ref (SCM obj, size_t idx);
SCM_INTERNAL void scm_init_values (void);
#endif /* SCM_VALUES_H */