Skip to content

Commit

Permalink
rename std* for Windows
Browse files Browse the repository at this point in the history
Windows doesn't seem to like the use of stdin, stdout, or stderr
as struct members.
  • Loading branch information
cjihrig committed Mar 14, 2020
1 parent e115a62 commit 28f2e31
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 36 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ int main(void) {
uvwasi_errno_t err;

/* Setup the initialization options. */
init_options.stdin = 0;
init_options.stdout = 1;
init_options.stderr = 2;
init_options.in = 0;
init_options.out = 1;
init_options.err = 2;
init_options.fd_table_size = 3;
init_options.argc = 3;
init_options.argv = calloc(3, sizeof(char*));
Expand Down Expand Up @@ -150,9 +150,9 @@ typedef struct uvwasi_options_s {
size_t argc;
char** argv;
char** envp;
uvwasi_fd_t stdin;
uvwasi_fd_t stdout;
uvwasi_fd_t stderr;
uvwasi_fd_t in;
uvwasi_fd_t out;
uvwasi_fd_t err;
const uvwasi_mem_t* allocator;
} uvwasi_options_t;
```
Expand Down
6 changes: 3 additions & 3 deletions include/uvwasi.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ typedef struct uvwasi_options_s {
size_t argc;
char** argv;
char** envp;
uvwasi_fd_t stdin;
uvwasi_fd_t stdout;
uvwasi_fd_t stderr;
uvwasi_fd_t in;
uvwasi_fd_t out;
uvwasi_fd_t err;
const uvwasi_mem_t* allocator;
} uvwasi_options_t;

Expand Down
6 changes: 3 additions & 3 deletions src/fd_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ uvwasi_errno_t uvwasi_fd_table_init(uvwasi_t* uvwasi,
}

/* Create the stdio FDs. */
err = uvwasi__insert_stdio(uvwasi, table, options->stdin, 0, "<stdin>");
err = uvwasi__insert_stdio(uvwasi, table, options->in, 0, "<stdin>");
if (err != UVWASI_ESUCCESS)
goto error_exit;

err = uvwasi__insert_stdio(uvwasi, table, options->stdout, 1, "<stdout>");
err = uvwasi__insert_stdio(uvwasi, table, options->out, 1, "<stdout>");
if (err != UVWASI_ESUCCESS)
goto error_exit;

err = uvwasi__insert_stdio(uvwasi, table, options->stderr, 2, "<stderr>");
err = uvwasi__insert_stdio(uvwasi, table, options->err, 2, "<stderr>");
if (err != UVWASI_ESUCCESS)
goto error_exit;

Expand Down
6 changes: 3 additions & 3 deletions test/test-args-get.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ int main(void) {
char** args_get_argv;
char* buf;

init_options.stdin = 0;
init_options.stdout = 1;
init_options.stderr = 2;
init_options.in = 0;
init_options.out = 1;
init_options.err = 2;
init_options.fd_table_size = 3;
init_options.argc = 3;
init_options.argv = calloc(3, sizeof(char*));
Expand Down
6 changes: 3 additions & 3 deletions test/test-basic-file-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ int main(void) {
uv_fs_req_cleanup(&req);
assert(r == 0 || r == UV_EEXIST);

init_options.stdin = 0;
init_options.stdout = 1;
init_options.stderr = 2;
init_options.in = 0;
init_options.out = 1;
init_options.err = 2;
init_options.fd_table_size = 3;
init_options.argc = 0;
init_options.argv = NULL;
Expand Down
6 changes: 3 additions & 3 deletions test/test-ebadf-input-validation.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ int main(void) {

test_void = (void*) &test_fdstat;

init_options.stdin = 0;
init_options.stdout = 1;
init_options.stderr = 2;
init_options.in = 0;
init_options.out = 1;
init_options.err = 2;
init_options.fd_table_size = 3;
init_options.argc = 0;
init_options.argv = NULL;
Expand Down
6 changes: 3 additions & 3 deletions test/test-environ-get.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ int main(void) {
char* buf;
size_t i;

init_options.stdin = 0;
init_options.stdout = 1;
init_options.stderr = 2;
init_options.in = 0;
init_options.out = 1;
init_options.err = 2;
init_options.fd_table_size = 3;
init_options.argc = 0;
init_options.argv = NULL;
Expand Down
6 changes: 3 additions & 3 deletions test/test-fd-prestat-dir-name.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ int main(void) {
uv_fs_req_cleanup(&req);
assert(r == 0 || r == UV_EEXIST);

init_options.stdin = 0;
init_options.stdout = 1;
init_options.stderr = 2;
init_options.in = 0;
init_options.out = 1;
init_options.err = 2;
init_options.fd_table_size = 3;
init_options.argc = 0;
init_options.argv = NULL;
Expand Down
6 changes: 3 additions & 3 deletions test/test-multiple-wasi-destroys.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ int main(void) {
uvwasi_options_t init_options;
uvwasi_errno_t err;

init_options.stdin = 0;
init_options.stdout = 1;
init_options.stderr = 2;
init_options.in = 0;
init_options.out = 1;
init_options.err = 2;
init_options.fd_table_size = 3;
init_options.argc = 0;
init_options.argv = NULL;
Expand Down
6 changes: 3 additions & 3 deletions test/test-path-create-remove-directory.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ int main(void) {
uv_fs_req_cleanup(&req);
assert(r == 0 || r == UV_ENOENT);

init_options.stdin = 0;
init_options.stdout = 1;
init_options.stderr = 2;
init_options.in = 0;
init_options.out = 1;
init_options.err = 2;
init_options.fd_table_size = 3;
init_options.argc = 0;
init_options.argv = NULL;
Expand Down
6 changes: 3 additions & 3 deletions test/test-random-get.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ int main(void) {
int success;
int i;

init_options.stdin = 0;
init_options.stdout = 1;
init_options.stderr = 2;
init_options.in = 0;
init_options.out = 1;
init_options.err = 2;
init_options.fd_table_size = 3;
init_options.argc = 0;
init_options.argv = NULL;
Expand Down

0 comments on commit 28f2e31

Please sign in to comment.