Skip to content

Commit 8b2a961

Browse files
git rid of glibc style __W* macros; users should not use those
1 parent bda908f commit 8b2a961

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

libc/include/llvm-libc-macros/linux/sys-wait-macros.h

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,17 @@
1111

1212
#include <linux/wait.h>
1313

14-
// Wait status info macros
15-
#define __WEXITSTATUS(status) (((status) & 0xff00) >> 8)
16-
#define __WTERMSIG(status) ((status) & 0x7f)
17-
#define __WIFEXITED(status) (__WTERMSIG(status) == 0)
18-
#define __WIFSIGNALED(status) ((__WTERMSIG(status) + 1) >= 2)
19-
#define __WIFSTOPPED(status) (__WTERMSIG(status) == 0x7f)
20-
#define __WIFCONTINUED(status) ((status) == __W_CONTINUED)
21-
#define __WCOREDUMP(status) ((status) & __WCOREFLAG)
22-
23-
// Macros for constructing status values.
24-
#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
25-
#define __W_STOPCODE(sig) ((sig) << 8 | 0x7f)
26-
#define __W_CONTINUED 0xffff
27-
#define __WCOREFLAG 0x80
28-
29-
#define WCOREDUMP(status) ((status) & __WCOREFLAG)
30-
#define WEXITSTATUS(status) __WEXITSTATUS(status)
31-
#define WIFCONTINUED(status) __WIFCONTINUED(status)
32-
#define WIFEXITED(status) __WIFEXITED(status)
33-
#define WIFSIGNALED(status) __WIFSIGNALED(status)
34-
#define WIFSTOPPED(status) __WIFSTOPPED(status)
14+
#define WCOREDUMP(status) ((status) & WCOREFLAG)
15+
#define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
16+
#define WIFCONTINUED(status) ((status) == 0xffff)
17+
#define WIFEXITED(status) (WTERMSIG(status) == 0)
18+
#define WIFSIGNALED(status) ((WTERMSIG(status) + 1) >= 2)
19+
#define WIFSTOPPED(status) (WTERMSIG(status) == 0x7f)
3520
#define WSTOPSIG(status) WEXITSTATUS(status)
36-
#define WTERMSIG(status) __WTERMSIG(status)
21+
#define WTERMSIG(status) ((status) & 0x7f)
3722

38-
#define WCOREFLAG __WCOREFLAG
39-
#define W_EXITCODE(ret, sig) __W_EXITCODE(ret, sig)
40-
#define W_STOPCODE(sig) __W_STOPCODE(sig)
23+
#define WCOREFLAG 0x80
24+
#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
25+
#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
4126

4227
#endif // LLVM_LIBC_MACROS_LINUX_SYS_WAIT_MACROS_H

0 commit comments

Comments
 (0)