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
7 changes: 4 additions & 3 deletions system/lib/standalone/standalone.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <emscripten.h>
#include <emscripten/heap.h>
#include <emscripten/console.h>
#include <wasi/api.h>
#include <wasi/wasi-helpers.h>

Expand Down Expand Up @@ -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);
Expand All @@ -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.
Expand Down