Skip to content

Commit 67261e8

Browse files
committed
Fix signature mismatch in standalone.c. NFC
See #18285
1 parent 7c9b97a commit 67261e8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

system/lib/standalone/standalone.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include <emscripten.h>
2121
#include <emscripten/heap.h>
22+
#include <emscripten/console.h>
2223
#include <wasi/api.h>
2324
#include <wasi/wasi-helpers.h>
2425

@@ -208,7 +209,7 @@ imported__wasi_fd_write(__wasi_fd_t fd,
208209
__wasi_size_t* nwritten);
209210

210211
// Write a buffer + a newline.
211-
static void wasi_writeln(__wasi_fd_t fd, char* buffer) {
212+
static void wasi_writeln(__wasi_fd_t fd, const char* buffer) {
212213
struct __wasi_ciovec_t iovs[2];
213214
iovs[0].buf = (uint8_t*)buffer;
214215
iovs[0].buf_len = strlen(buffer);
@@ -218,9 +219,9 @@ static void wasi_writeln(__wasi_fd_t fd, char* buffer) {
218219
imported__wasi_fd_write(fd, iovs, 2, &nwritten);
219220
}
220221

221-
void _emscripten_out(char* text) { wasi_writeln(1, text); }
222+
void _emscripten_out(const char* text) { wasi_writeln(1, text); }
222223

223-
void _emscripten_err(char* text) { wasi_writeln(2, text); }
224+
void _emscripten_err(const char* text) { wasi_writeln(2, text); }
224225

225226
// In the non-standalone build we define this helper function in JS to avoid
226227
// signture mismatch issues.

0 commit comments

Comments
 (0)