Fix WIFEXITED missing from MinGW/MSYS2 (#2609)

* WIFEXITED missing from MinGW/MSYS2, added defines

* Found source of the WIFEXITED macro in the binutils-gdb repo. Now with less pointer manipulation.
This commit is contained in:
Jean Berniolles
2020-10-27 13:33:25 -04:00
committed by GitHub
parent 34b8ed4cf0
commit 77ac9bfcc6
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -49,6 +49,14 @@
# include <direct.h> // mkdir
# include <psapi.h> // GetProcessMemoryInfo
# include <thread>
// These macros taken from gdbsupport/gdb_wait.h in binutils-gdb
# ifndef WIFEXITED
# ifdef __MINGW32__
# define WIFEXITED(w) (((w) & 0xC0000000) == 0)
# else
# define WIFEXITED(w) (((w) & 0377) == 0)
# endif
# endif
#else
# include <sys/time.h>
# include <sys/wait.h> // Needed on FreeBSD for WIFEXITED