mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-12 15:37:35 +02:00
plan9 fixes - can't use #if preprocessor statements inside macros.
also, no log2() by default, defining it in terms of log().
This commit is contained in:
parent
41f54a7f41
commit
821546244a
3 changed files with 13 additions and 6 deletions
12
eval.c
12
eval.c
|
@ -1543,16 +1543,16 @@ sexp sexp_vm (sexp ctx, sexp proc) {
|
|||
case OP_NULLP:
|
||||
_ARG1 = sexp_make_boolean(sexp_nullp(_ARG1)); break;
|
||||
case OP_INTEGERP:
|
||||
_ARG1 = sexp_make_boolean(sexp_integerp(_ARG1)
|
||||
j = sexp_integerp(_ARG1);
|
||||
#if USE_BIGNUMS
|
||||
|| sexp_bignump(_ARG1)
|
||||
if (! j) j = sexp_bignump(_ARG1);
|
||||
#endif
|
||||
#if USE_FLONUMS
|
||||
|| (sexp_flonump(_ARG1)
|
||||
&& (sexp_flonum_value(_ARG1)
|
||||
== trunc(sexp_flonum_value(_ARG1))))
|
||||
if (! j)
|
||||
j = (sexp_flonump(_ARG1)
|
||||
&& (sexp_flonum_value(_ARG1) == trunc(sexp_flonum_value(_ARG1))));
|
||||
#endif
|
||||
);
|
||||
_ARG1 = sexp_make_boolean(j);
|
||||
break;
|
||||
case OP_SYMBOLP:
|
||||
_ARG1 = sexp_make_boolean(sexp_symbolp(_ARG1)); break;
|
||||
|
|
3
mkfile
3
mkfile
|
@ -34,3 +34,6 @@ clean:V:
|
|||
install:V: $BIN/$TARG
|
||||
mkdir -p $MODDIR
|
||||
cp init.scm $MODDIR/
|
||||
|
||||
test:V:
|
||||
./chibi-scheme tests/r5rs-tests.scm
|
||||
|
|
|
@ -186,6 +186,10 @@ sexp sexp_read_bignum (sexp ctx, sexp in, sexp_uint_t init,
|
|||
return sexp_bignum_normalize(res);
|
||||
}
|
||||
|
||||
#ifdef PLAN9
|
||||
#define log2(n) (log(n)/log(2))
|
||||
#endif
|
||||
|
||||
sexp sexp_write_bignum (sexp ctx, sexp a, sexp out, sexp_uint_t base) {
|
||||
int i, str_len, lg_base = trunc(log2(base));
|
||||
char *data;
|
||||
|
|
Loading…
Add table
Reference in a new issue