diff --git a/system/lib/standalone/standalone.c b/system/lib/standalone/standalone.c index 389add8adbed3..690106cce8cf9 100644 --- a/system/lib/standalone/standalone.c +++ b/system/lib/standalone/standalone.c @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -208,7 +209,7 @@ imported__wasi_fd_write(__wasi_fd_t fd, __wasi_size_t* nwritten); // Write a buffer + a newline. -static void wasi_writeln(__wasi_fd_t fd, char* buffer) { +static void wasi_writeln(__wasi_fd_t fd, const char* buffer) { struct __wasi_ciovec_t iovs[2]; iovs[0].buf = (uint8_t*)buffer; iovs[0].buf_len = strlen(buffer); @@ -218,9 +219,9 @@ static void wasi_writeln(__wasi_fd_t fd, char* buffer) { imported__wasi_fd_write(fd, iovs, 2, &nwritten); } -void _emscripten_out(char* text) { wasi_writeln(1, text); } +void _emscripten_out(const char* text) { wasi_writeln(1, text); } -void _emscripten_err(char* text) { wasi_writeln(2, text); } +void _emscripten_err(const char* text) { wasi_writeln(2, text); } // In the non-standalone build we define this helper function in JS to avoid // signture mismatch issues.