From 26e6e0c15d9edf7f06bbb9bf792cfc3c7b0d63a3 Mon Sep 17 00:00:00 2001 From: rexim Date: Sat, 30 Jan 2021 18:03:58 +0700 Subject: [PATCH 1/9] (#5) Deprecated FOREACH_VARGS and replace it with FOREACH_VARGS_TYPE --- ChangeLog.md | 4 ++++ examples/foreach.c | 2 +- nobuild.h | 37 +++++++++++++++++++++++++------------ 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 1e676fd..12ce3fa 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,6 +4,10 @@ *Not Released Yet* +## Deprecations + +- `FOREACH_VARGS(...)` is deprecated. Use `FOREACH_VARGS_TYPE(...)` instead. + # 0.2.0 — Removing Everything *2021-01-30* diff --git a/examples/foreach.c b/examples/foreach.c index c378575..54f9a91 100644 --- a/examples/foreach.c +++ b/examples/foreach.c @@ -5,7 +5,7 @@ void foreach_vargs(int ignore, ...) { va_list args; - FOREACH_VARGS(ignore, arg, args, { + FOREACH_VARGS_TYPE(ignore, const char*, arg, args, { INFO(" %s", arg); }); } diff --git a/nobuild.h b/nobuild.h index c5165f9..89c5258 100644 --- a/nobuild.h +++ b/nobuild.h @@ -113,8 +113,21 @@ #define PATH_SEP_LEN (sizeof(PATH_SEP) - 1) +#define FOREACH_VARGS_TYPE(param, type, arg, args, body) \ + do { \ + va_start(args, param); \ + for (type arg = va_arg(args, type); \ + arg != NULL; \ + arg = va_arg(args, type)) \ + { \ + body; \ + } \ + va_end(args); \ + } while(0) + #define FOREACH_VARGS(param, arg, args, body) \ do { \ + WARN("DEPRECATED: Please don't use FOREACH_VARGS(...). Please use FOREACH_VARGS_TYPE(...) instead. FOREACH_VARGS(...) will be removed on the next major release."); \ va_start(args, param); \ for (const char *arg = va_arg(args, const char *); \ arg != NULL; \ @@ -277,7 +290,7 @@ const char *build__join(const char *sep, ...) va_list args; - FOREACH_VARGS(sep, arg, args, { + FOREACH_VARGS_TYPE(sep, const char*, arg, args, { length += strlen(arg); seps_count += 1; }); @@ -288,7 +301,7 @@ const char *build__join(const char *sep, ...) char *result = malloc(length + seps_count * sep_len + 1); length = 0; - FOREACH_VARGS(sep, arg, args, { + FOREACH_VARGS_TYPE(sep, const char*, arg, args, { size_t n = strlen(arg); memcpy(result + length, arg, n); length += n; @@ -315,7 +328,7 @@ const char *build__deprecated_concat_sep(const char *sep, ...) va_list args; - FOREACH_VARGS(sep, arg, args, { + FOREACH_VARGS_TYPE(sep, const char*, arg, args, { length += strlen(arg); seps_count += 1; }); @@ -326,7 +339,7 @@ const char *build__deprecated_concat_sep(const char *sep, ...) char *result = malloc(length + seps_count * sep_len + 1); length = 0; - FOREACH_VARGS(sep, arg, args, { + FOREACH_VARGS_TYPE(sep, const char*, arg, args, { size_t n = strlen(arg); memcpy(result + length, arg, n); length += n; @@ -353,7 +366,7 @@ const char *concat_sep_impl(const char *sep, ...) va_list args; - FOREACH_VARGS(sep, arg, args, { + FOREACH_VARGS_TYPE(sep, const char*, arg, args, { length += strlen(arg); seps_count += 1; }); @@ -364,7 +377,7 @@ const char *concat_sep_impl(const char *sep, ...) char *result = malloc(length + seps_count * sep_len + 1); length = 0; - FOREACH_VARGS(sep, arg, args, { + FOREACH_VARGS_TYPE(sep, const char*, arg, args, { size_t n = strlen(arg); memcpy(result + length, arg, n); length += n; @@ -388,7 +401,7 @@ void mkdirs_impl(int ignore, ...) va_list args; - FOREACH_VARGS(ignore, arg, args, { + FOREACH_VARGS_TYPE(ignore, const char*, arg, args, { length += strlen(arg); seps_count += 1; }); @@ -399,7 +412,7 @@ void mkdirs_impl(int ignore, ...) char *result = malloc(length + seps_count * PATH_SEP_LEN + 1); length = 0; - FOREACH_VARGS(ignore, arg, args, { + FOREACH_VARGS_TYPE(ignore, const char*, arg, args, { size_t n = strlen(arg); memcpy(result + length, arg, n); length += n; @@ -430,14 +443,14 @@ const char *concat_impl(int ignore, ...) { size_t length = 0; va_list args; - FOREACH_VARGS(ignore, arg, args, { + FOREACH_VARGS_TYPE(ignore, const char*, arg, args, { length += strlen(arg); }); char *result = malloc(length + 1); length = 0; - FOREACH_VARGS(ignore, arg, args, { + FOREACH_VARGS_TYPE(ignore, const char*, arg, args, { size_t n = strlen(arg); memcpy(result + length, arg, n); length += n; @@ -501,14 +514,14 @@ void cmd_impl(int ignore, ...) size_t argc = 0; va_list args; - FOREACH_VARGS(ignore, arg, args, { + FOREACH_VARGS_TYPE(ignore, const char*, arg, args, { argc += 1; }); const char **argv = malloc(sizeof(const char*) * (argc + 1)); argc = 0; - FOREACH_VARGS(ignore, arg, args, { + FOREACH_VARGS_TYPE(ignore, const char*, arg, args, { argv[argc++] = arg; }); argv[argc] = NULL; From 1f635227e0a8a59d9c9b7645b046b99d2b0891f6 Mon Sep 17 00:00:00 2001 From: rexim Date: Sat, 30 Jan 2021 18:27:05 +0700 Subject: [PATCH 2/9] Enable many warning flags and fix the problems discovered by them --- examples/file.c | 2 +- examples/foreach.c | 2 +- examples/logging.c | 2 +- examples/string.c | 2 +- nobuild.c | 7 ++++++- nobuild.h | 8 +++++--- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/examples/file.c b/examples/file.c index 6718db3..ba221f4 100644 --- a/examples/file.c +++ b/examples/file.c @@ -18,7 +18,7 @@ void print_file_recursively(const char *path) } } -int main(int argc, char *argv[]) +int main(void) { DEMO(IS_DIR("./nobuild.c")); DEMO(IS_DIR("./examples")); diff --git a/examples/foreach.c b/examples/foreach.c index 54f9a91..ea9dab8 100644 --- a/examples/foreach.c +++ b/examples/foreach.c @@ -34,7 +34,7 @@ void foreach_file_in_dir(const char *dir_path) expr; \ } while(0) -int main(int argc, char *argv[]) +int main(void) { DEMO(foreach_vargs(69, "foo", "bar", "baz", NULL)); DEMO(foreach_array()); diff --git a/examples/logging.c b/examples/logging.c index 27c08d1..e512e60 100644 --- a/examples/logging.c +++ b/examples/logging.c @@ -1,7 +1,7 @@ #define NOBUILD_IMPLEMENTATION #include "../nobuild.h" -int main(int argc, char *argv[]) +int main(void) { INFO(" Informational Message"); WARN(" Warning Message"); diff --git a/examples/string.c b/examples/string.c index 4393d86..7bbf97b 100644 --- a/examples/string.c +++ b/examples/string.c @@ -7,7 +7,7 @@ #define DEMO_D(expr) \ INFO(" " #expr " == %d", expr) -int main(int argc, char *argv[]) +int main(void) { DEMO_S(CONCAT("foo", "bar", "baz")); DEMO_S(PATH("foo", "bar", "baz")); diff --git a/nobuild.c b/nobuild.c index 7221959..8538f38 100644 --- a/nobuild.c +++ b/nobuild.c @@ -1,6 +1,8 @@ #define NOBUILD_IMPLEMENTATION #include "./nobuild.h" +#define CFLAGS "-Wall", "-Wextra", "-std=c11"//, "-pedantic" + void check_example(const char *example) { const char *example_path = PATH("examples", NOEXT(example)); @@ -11,7 +13,10 @@ void check_example(const char *example) CMD("cl.exe", "/Fe.\\examples\\", PATH("examples", example)); CMD(CONCAT(example_path, ".exe")); #else - CMD("cc", "-o", example_path, PATH("examples", example)); + const char *cc = getenv("CC"); + if (cc == NULL) cc = "cc"; + + CMD(cc, CFLAGS, "-o", example_path, PATH("examples", example)); CMD(example_path); #endif // _WIN32 } diff --git a/nobuild.h b/nobuild.h index 89c5258..e170f1e 100644 --- a/nobuild.h +++ b/nobuild.h @@ -553,6 +553,8 @@ const char *remove_ext(const char *path) { WARN("DEPRECATED: Please use `NOEXT(path)` instead of `remove_ext(path)`. `remove_ext(path)` will be removed in the next major release."); nobuild__remove_ext(path); + + return NULL; } char *shift(int *argc, char ***argv) @@ -629,7 +631,7 @@ int nobuild__is_dir(const char *path) exit(1); } - return (statbuf.st_mode & S_IFMT) == S_IFDIR; + return S_ISDIR(statbuf.st_mode); #endif // _WIN32 } @@ -643,7 +645,7 @@ void nobuild__rm(const char *path) }); if (rmdir(path) < 0) { - if (errno = ENOENT) { + if (errno == ENOENT) { WARN("directory %s does not exist"); } else { ERRO("could not remove directory %s: %s", path, strerror(errno)); @@ -652,7 +654,7 @@ void nobuild__rm(const char *path) } } else { if (unlink(path) < 0) { - if (errno = ENOENT) { + if (errno == ENOENT) { WARN("file %s does not exist"); } else { ERRO("could not remove file %s: %s", path, strerror(errno)); From b47984486ab215b85928f976b210d256542b5be7 Mon Sep 17 00:00:00 2001 From: rexim Date: Sat, 30 Jan 2021 21:17:41 +0700 Subject: [PATCH 3/9] (#5) Introduce PIPE(...) macro draft --- ChangeLog.md | 2 + README.md | 2 +- examples/.gitignore | 3 +- examples/pipe.c | 9 ++ nobuild.c | 2 +- nobuild.h | 247 ++++++++++++++++++++++++++++++++++++++++---- 6 files changed, 243 insertions(+), 22 deletions(-) create mode 100644 examples/pipe.c diff --git a/ChangeLog.md b/ChangeLog.md index 12ce3fa..4938c43 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,6 +4,8 @@ *Not Released Yet* +- Introduced `PIPE(...)` macro. + ## Deprecations - `FOREACH_VARGS(...)` is deprecated. Use `FOREACH_VARGS_TYPE(...)` instead. diff --git a/README.md b/README.md index 08b44a8..23abea4 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The idea is that you should not need anything but a C compiler to build a C proj Try it out right here: -``` +```console $ cc ./nobuild.c -o nobuild $ ./nobuild ``` diff --git a/examples/.gitignore b/examples/.gitignore index 29538b7..9c39486 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -1,4 +1,5 @@ string foreach logging -file \ No newline at end of file +file +pipe \ No newline at end of file diff --git a/examples/pipe.c b/examples/pipe.c new file mode 100644 index 0000000..54c321f --- /dev/null +++ b/examples/pipe.c @@ -0,0 +1,9 @@ +#define NOBUILD_IMPLEMENTATION +#include "../nobuild.h" + +int main(void) +{ + PIPE(IN("./nobuild.c"), CHAIN("cat")); + + return 0; +} diff --git a/nobuild.c b/nobuild.c index 8538f38..7edc852 100644 --- a/nobuild.c +++ b/nobuild.c @@ -1,7 +1,7 @@ #define NOBUILD_IMPLEMENTATION #include "./nobuild.h" -#define CFLAGS "-Wall", "-Wextra", "-std=c11"//, "-pedantic" +#define CFLAGS "-Wall", "-Wextra", "-std=c11", "-pedantic", "-ggdb" void check_example(const char *example) { diff --git a/nobuild.h b/nobuild.h index e170f1e..99c94e0 100644 --- a/nobuild.h +++ b/nobuild.h @@ -30,6 +30,10 @@ #ifndef NOBUILD_H_ #define NOBUILD_H_ +#ifndef _WIN32 +#define _POSIX_C_SOURCE 200809L +#endif // _WIN32 + #include #include #include @@ -100,8 +104,10 @@ # include # include # include +# include #endif // _WIN32 + // TODO(#1): no way to disable echo in nobuild scripts // TODO(#2): no way to ignore fails @@ -178,6 +184,29 @@ void nobuild_exec(const char **argv); const char *remove_ext(const char *path); char *shift(int *argc, char ***argv); void nobuild__rm(const char *path); +void nobuild__posix_wait_for_pid(pid_t pid); + +typedef enum { + PIPE_ARG_END, + PIPE_ARG_IN, + PIPE_ARG_OUT, + PIPE_ARG_CHAIN, +} Pipe_Arg_Type; + +const char *nobuild__pipe_arg_as_cstr(Pipe_Arg_Type type); + +typedef struct { + Pipe_Arg_Type type; + const char** args; +} Pipe_Arg; + +void nobuild__pipe(int ignore, ...); +Pipe_Arg nobuild__make_pipe_arg(Pipe_Arg_Type type, ...); + +#define PIPE(...) nobuild__pipe(69, __VA_ARGS__, nobuild__make_pipe_arg(PIPE_ARG_END, NULL)) +#define IN(path) nobuild__make_pipe_arg(PIPE_ARG_IN, path, NULL) +#define OUT(path) nobuild__make_pipe_arg(PIPE_ARG_OUT, path, NULL) +#define CHAIN(...) nobuild__make_pipe_arg(PIPE_ARG_CHAIN, __VA_ARGS__, NULL) #define CONCAT(...) concat_impl(69, __VA_ARGS__, NULL) #define CONCAT_SEP(sep, ...) build__deprecated_concat_sep(sep, __VA_ARGS__, NULL) @@ -486,25 +515,7 @@ void nobuild_exec(const char **argv) exit(1); } } else { - for (;;) { - int wstatus = 0; - wait(&wstatus); - - if (WIFEXITED(wstatus)) { - int exit_status = WEXITSTATUS(wstatus); - if (exit_status != 0) { - ERRO("command exited with exit code %d", exit_status); - exit(1); - } - - break; - } - - if (WIFSIGNALED(wstatus)) { - ERRO("command process was terminated by signal %d", WTERMSIG(wstatus)); - exit(1); - } - } + nobuild__posix_wait_for_pid(cpid); } #endif // _WIN32 } @@ -664,4 +675,202 @@ void nobuild__rm(const char *path) } } +#ifdef _WIN32 +void nobuild__pipe(int ignore, ...) +{ + ERRO("TODO: piping is not implemented on Windows at all"); + exit(1); +} +#else +void nobuild__pipe(int ignore, ...) +{ + const char *input_filepath = NULL; + const char *output_filepath = NULL; + size_t cmds_count = 0; + + va_list args; + va_start(args, ignore); + { + Pipe_Arg arg = va_arg(args, Pipe_Arg); + while (arg.type != PIPE_ARG_END) { + switch (arg.type) { + case PIPE_ARG_IN: { + if (input_filepath == NULL) { + input_filepath = arg.args[0]; + } else { + // TODO: PIPE does not report where exactly a syntactic error has happened + ERRO("input file was already set for the pipe"); + exit(1); + } + } break; + + case PIPE_ARG_OUT: { + if (output_filepath == NULL) { + output_filepath = arg.args[0]; + } else { + ERRO("output file was already set for the pipe"); + exit(1); + } + } break; + + case PIPE_ARG_CHAIN: { + cmds_count += 1; + } break; + + case PIPE_ARG_END: + default: { + assert(0 && "unreachable"); + } + } + + arg = va_arg(args, Pipe_Arg); + } + } + va_end(args); + + if (cmds_count == 0) { + ERRO("no chains provided for the pipe"); + exit(1); + } + + Pipe_Arg *cmds = malloc(sizeof(Pipe_Arg) * cmds_count); + pid_t *cpids = malloc(sizeof(pid_t) * cmds_count); + + cmds_count = 0; + va_start(args, ignore); + { + Pipe_Arg arg = va_arg(args, Pipe_Arg); + while (arg.type != PIPE_ARG_END) { + if (arg.type == PIPE_ARG_CHAIN) { + cmds[cmds_count++] = arg; + } + arg = va_arg(args, Pipe_Arg); + } + } + va_end(args); + + // TODO: input/output piping is not implemented for Linux + for (size_t i = 0; i < cmds_count; ++i) { + cpids[i] = fork(); + if (cpids[i] < 0) { + ERRO("could not fork a child: %s", strerror(errno)); + exit(1); + } + + if (cpids[i] == 0) { + // Chain is first and there is input file + if (i == 0) { + if (input_filepath != NULL) { + int fdin = open(input_filepath, O_RDONLY); + if (fdin < 0) { + ERRO("could not open file %s: %s", + input_filepath, strerror(errno)); + exit(1); + } + + if (dup2(fdin, STDIN_FILENO) < 0) { + ERRO("could not duplication file descriptor for %s: %s", + input_filepath, strerror(errno)); + exit(1); + } + } + } else { + assert(0 && "input piping is not implemented"); + } + + // Chain is last and there is output file + if (i == cmds_count - 1) { + if (output_filepath != NULL) { + int fdout = open(output_filepath, + O_WRONLY | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (fdout < 0) { + ERRO("could not open file %s: %s", + output_filepath, strerror(errno)); + exit(1); + } + + if (dup2(fdout, STDOUT_FILENO) < 0) { + ERRO("could not duplication file descriptor for %s: %s", + output_filepath, strerror(errno)); + exit(1); + } + } + } else { + assert(0 && "output piping is not implemented"); + } + + if (execvp(cmds[i].args[0], (char * const*) cmds[i].args) < 0) { + ERRO("could not execute command: %s", strerror(errno)); + exit(1); + } + } + } + + for (size_t i = 0; i < cmds_count; ++i) { + nobuild__posix_wait_for_pid(cpids[i]); + } +} +#endif // _WIN32 + +void nobuild__posix_wait_for_pid(pid_t pid) +{ + for (;;) { + int wstatus = 0; + waitpid(pid, &wstatus, 0); + + if (WIFEXITED(wstatus)) { + int exit_status = WEXITSTATUS(wstatus); + if (exit_status != 0) { + ERRO("command exited with exit code %d", exit_status); + exit(1); + } + + break; + } + + if (WIFSIGNALED(wstatus)) { + ERRO("command process was terminated by %s", strsignal(WTERMSIG(wstatus))); + exit(1); + } + } +} + +Pipe_Arg nobuild__make_pipe_arg(Pipe_Arg_Type type, ...) +{ + Pipe_Arg result = { + .type = type + }; + + va_list args; + + size_t count = 0; + FOREACH_VARGS_TYPE(type, const char*, arg, args, { + count += 1; + }); + + result.args = malloc(sizeof(const char*) * (count + 1)); + + count = 0; + FOREACH_VARGS_TYPE(type, const char*, arg, args, { + result.args[count++] = arg; + }); + result.args[count] = NULL; + + return result; +} + +const char *nobuild__pipe_arg_as_cstr(Pipe_Arg_Type type) +{ + switch (type) { + case PIPE_ARG_IN: return "PIPE_ARG_IN"; + case PIPE_ARG_OUT: return "PIPE_ARG_OUT"; + case PIPE_ARG_CHAIN: return "PIPE_ARG_CHAIN"; + default: { + assert(0 && "nobuild__pipe_arg_as_cstr: unreachable"); + return NULL; + } + } +} + #endif // NOBUILD_IMPLEMENTATION From 6c05cc2d23141104843c17b266e27943a051c173 Mon Sep 17 00:00:00 2001 From: rexim Date: Sat, 30 Jan 2021 21:18:48 +0700 Subject: [PATCH 4/9] Add TODO(#14) --- nobuild.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nobuild.h b/nobuild.h index 99c94e0..f616e30 100644 --- a/nobuild.h +++ b/nobuild.h @@ -678,7 +678,7 @@ void nobuild__rm(const char *path) #ifdef _WIN32 void nobuild__pipe(int ignore, ...) { - ERRO("TODO: piping is not implemented on Windows at all"); + ERRO("TODO(#14): piping is not implemented on Windows at all"); exit(1); } #else From 40269e64c03d905809800c0610042d668d335198 Mon Sep 17 00:00:00 2001 From: rexim Date: Sat, 30 Jan 2021 21:18:49 +0700 Subject: [PATCH 5/9] Add TODO(#15) --- nobuild.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nobuild.h b/nobuild.h index f616e30..92150bc 100644 --- a/nobuild.h +++ b/nobuild.h @@ -698,7 +698,7 @@ void nobuild__pipe(int ignore, ...) if (input_filepath == NULL) { input_filepath = arg.args[0]; } else { - // TODO: PIPE does not report where exactly a syntactic error has happened + // TODO(#15): PIPE does not report where exactly a syntactic error has happened ERRO("input file was already set for the pipe"); exit(1); } From 72872ac6bd4e830bad0df8557714517599dfdb84 Mon Sep 17 00:00:00 2001 From: rexim Date: Sat, 30 Jan 2021 21:18:49 +0700 Subject: [PATCH 6/9] Add TODO(#16) --- nobuild.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nobuild.h b/nobuild.h index 92150bc..546807d 100644 --- a/nobuild.h +++ b/nobuild.h @@ -749,7 +749,7 @@ void nobuild__pipe(int ignore, ...) } va_end(args); - // TODO: input/output piping is not implemented for Linux + // TODO(#16): input/output piping is not implemented for Linux for (size_t i = 0; i < cmds_count; ++i) { cpids[i] = fork(); if (cpids[i] < 0) { From f25e8462a2234f51632d31877d985cfac49bee99 Mon Sep 17 00:00:00 2001 From: rexim Date: Sat, 30 Jan 2021 21:19:50 +0700 Subject: [PATCH 7/9] (#5) Don't crash the windows build just because PIPE is not implemented --- examples/pipe.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/pipe.c b/examples/pipe.c index 54c321f..b19b3ab 100644 --- a/examples/pipe.c +++ b/examples/pipe.c @@ -3,7 +3,11 @@ int main(void) { +#if _WIN32 + WARN("Piping is not implemented on Windows yet"); +#else PIPE(IN("./nobuild.c"), CHAIN("cat")); +#endif return 0; } From 7f112ce388c69696f5c5d7f6e29bb20e2df74eb1 Mon Sep 17 00:00:00 2001 From: rexim Date: Sat, 30 Jan 2021 21:22:40 +0700 Subject: [PATCH 8/9] (#5) exclude nobuild__posix_wait_for_pid from windows --- nobuild.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nobuild.h b/nobuild.h index 546807d..6275989 100644 --- a/nobuild.h +++ b/nobuild.h @@ -184,7 +184,10 @@ void nobuild_exec(const char **argv); const char *remove_ext(const char *path); char *shift(int *argc, char ***argv); void nobuild__rm(const char *path); + +#ifndef _WIN32 void nobuild__posix_wait_for_pid(pid_t pid); +#endif typedef enum { PIPE_ARG_END, @@ -813,6 +816,7 @@ void nobuild__pipe(int ignore, ...) } #endif // _WIN32 +#ifndef _WIN32 void nobuild__posix_wait_for_pid(pid_t pid) { for (;;) { @@ -835,6 +839,7 @@ void nobuild__posix_wait_for_pid(pid_t pid) } } } +#endif Pipe_Arg nobuild__make_pipe_arg(Pipe_Arg_Type type, ...) { From 4f4f8c0757aea8dbd14db613c825d37f391f028f Mon Sep 17 00:00:00 2001 From: rexim Date: Sat, 30 Jan 2021 21:24:50 +0700 Subject: [PATCH 9/9] Add TODO(#17) --- nobuild.h | 1 + 1 file changed, 1 insertion(+) diff --git a/nobuild.h b/nobuild.h index 6275989..57dd273 100644 --- a/nobuild.h +++ b/nobuild.h @@ -207,6 +207,7 @@ void nobuild__pipe(int ignore, ...); Pipe_Arg nobuild__make_pipe_arg(Pipe_Arg_Type type, ...); #define PIPE(...) nobuild__pipe(69, __VA_ARGS__, nobuild__make_pipe_arg(PIPE_ARG_END, NULL)) +// TODO(#17): IN and OUT are already taken by WinAPI #define IN(path) nobuild__make_pipe_arg(PIPE_ARG_IN, path, NULL) #define OUT(path) nobuild__make_pipe_arg(PIPE_ARG_OUT, path, NULL) #define CHAIN(...) nobuild__make_pipe_arg(PIPE_ARG_CHAIN, __VA_ARGS__, NULL)