From 254e81ef74e365ad63a79548804e9218048a8918 Mon Sep 17 00:00:00 2001 From: auronandace Date: Sat, 28 Mar 2026 15:12:54 +0000 Subject: [PATCH] move sys_wait bits from C to cbindgen --- include/bits/sys/wait.h | 13 ------------- src/header/sys_wait/cbindgen.toml | 11 ++++++++++- 2 files changed, 10 insertions(+), 14 deletions(-) delete mode 100644 include/bits/sys/wait.h diff --git a/include/bits/sys/wait.h b/include/bits/sys/wait.h deleted file mode 100644 index c76dbcab95..0000000000 --- a/include/bits/sys/wait.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _BITS_SYS_WAIT_H -#define _BITS_SYS_WAIT_H - -#define WEXITSTATUS(s) (((s) >> 8) & 0xff) -#define WTERMSIG(s) ((s) & 0x7f) -#define WSTOPSIG(s) WEXITSTATUS(s) -#define WCOREDUMP(s) (((s) & 0x80) != 0) -#define WIFEXITED(s) (((s) & 0x7f) == 0) -#define WIFSTOPPED(s) (((s) & 0xff) == 0x7f) -#define WIFSIGNALED(s) (((((s) & 0x7f) + 1U) & 0x7f) >= 2) // Ends with 1111111 or 10000000 -#define WIFCONTINUED(s) ((s) == 0xffff) - -#endif /* _BITS_SYS_WAIT_H */ diff --git a/src/header/sys_wait/cbindgen.toml b/src/header/sys_wait/cbindgen.toml index 7b39e2b8a9..807d8fb398 100644 --- a/src/header/sys_wait/cbindgen.toml +++ b/src/header/sys_wait/cbindgen.toml @@ -1,6 +1,15 @@ sys_includes = ["sys/types.h", "sys/resource.h"] include_guard = "_SYS_WAIT_H" -trailer = "#include " +trailer = """ +#define WEXITSTATUS(s) (((s) >> 8) & 0xff) +#define WTERMSIG(s) ((s) & 0x7f) +#define WSTOPSIG(s) WEXITSTATUS(s) +#define WCOREDUMP(s) (((s) & 0x80) != 0) +#define WIFEXITED(s) (((s) & 0x7f) == 0) +#define WIFSTOPPED(s) (((s) & 0xff) == 0x7f) +#define WIFSIGNALED(s) (((((s) & 0x7f) + 1U) & 0x7f) >= 2) // Ends with 1111111 or 10000000 +#define WIFCONTINUED(s) ((s) == 0xffff) +""" language = "C" style = "Tag" no_includes = true