Skip to content

Commit

Permalink
Fix signature mismatch in standalone.c. NFC
Browse files Browse the repository at this point in the history
See #18285
  • Loading branch information
sbc100 committed Dec 5, 2022
1 parent 7c9b97a commit 67261e8
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit 67261e8

Please sign in to comment.