From 51e81139e6b852f593c581d14afa20bb1e8762f8 Mon Sep 17 00:00:00 2001 From: Rewbert Date: Sat, 10 Jan 2026 12:22:35 +0100 Subject: [PATCH 1/2] add some preprocessor guards --- src/runtime/eval.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/runtime/eval.c b/src/runtime/eval.c index 232c1b59..d6d3daea 100644 --- a/src/runtime/eval.c +++ b/src/runtime/eval.c @@ -8,6 +8,11 @@ #define WANT_GMP 0 #endif /* defined(WANT_GMP) */ + +#if WANT_STDIO +#include +#include +#endif #include #include #include @@ -3925,10 +3930,12 @@ printrec(BFILE *f, struct print_bits *pb, NODEPTR n, bool prefix) break; case T_IO_CCALL: putb('^', f); putsb(FFI_IX(GETVALUE(n)).ffi_name, f); break; case T_BADDYN: putb('^', f); putsb(CSTR(n), f); break; +#if WANT_TICK case T_TICK: putb('!', f); print_string(f, tick_table[GETVALUE(n)].tick_name); break; +#endif default: if (0 <= tag && tag <= T_LAST_TAG) #if WANT_TICK && WANT_TAGNAMES @@ -6382,7 +6389,7 @@ mhs_init_args( *file_sizep = combexprlen; #endif } else { -#if WANT_STDIO +#if WANT_STDIO & WANT_ARGS /* Open a regular file */ FILE *f = fopen(inname, "r"); if (!f) @@ -7224,10 +7231,6 @@ const struct ffi_entry ffi_table[] = { { "poke_ullong", 2, mhs_poke_ullong}, { "poke_ulong", 2, mhs_poke_ulong}, { "poke_size_t", 2, mhs_poke_size_t}, -#if WANT_FLOAT - { "peek_flt", 1, mhs_peek_flt}, - { "poke_flt", 2, mhs_poke_flt}, -#endif /* WANT_FLOAT */ { "sizeof_char", 0, mhs_sizeof_char}, { "sizeof_short", 0, mhs_sizeof_short}, { "sizeof_int", 0, mhs_sizeof_int}, From bf04708795c644caaae06d49fca44273c5917dcb Mon Sep 17 00:00:00 2001 From: Rewbert Date: Sat, 10 Jan 2026 14:46:11 +0100 Subject: [PATCH 2/2] another small fix, but less obviously correct than the other one. Left a note for Lennart. --- src/runtime/eval.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/runtime/eval.c b/src/runtime/eval.c index d6d3daea..63651433 100644 --- a/src/runtime/eval.c +++ b/src/runtime/eval.c @@ -26,10 +26,14 @@ #endif /* __EMSCRIPTEN__ */ #if WANT_DIR #include -#include #include #include #endif /* WANT_DIR */ +#if WANT_DIR || WANT_STDIO +// The call `unlink` is guarded under WANT_STDIO, but the rest seems to be under WANT_DIR. +// Lennart, how do you want to include unistd.h? +#include +#endif #if WANT_TIME #include #endif