Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/runtime/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
#define WANT_GMP 0
#endif /* defined(WANT_GMP) */


#if WANT_STDIO
#include <stdio.h>
#include <locale.h>
#endif
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
Expand All @@ -21,10 +26,14 @@
#endif /* __EMSCRIPTEN__ */
#if WANT_DIR
#include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#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?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need WANT_UNISTD?
I don't remember exactly what's used from unistd.h

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I noticed was unlink, because with the current set of flags it did not work. For my specific platform I don't think I need unistd, so a guard that chucks away the entire thing works well for me lol.

#include <unistd.h>
#endif
#if WANT_TIME
#include <time.h>
#endif
Expand Down Expand Up @@ -3925,10 +3934,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
Expand Down Expand Up @@ -6382,7 +6393,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)
Expand Down Expand Up @@ -7224,10 +7235,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},
Expand Down
Loading