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 18:33:25 +01:00 committed by GitHub
parent 34b8ed4cf0
commit 77ac9bfcc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -27,6 +27,7 @@ James Hutchinson
Jamey Hicks Jamey Hicks
James Pallister James Pallister
Jan Van Winkel Jan Van Winkel
Jean Berniolles
Jeremy Bennett Jeremy Bennett
John Coiner John Coiner
John Demme John Demme

View File

@ -49,6 +49,14 @@
# include <direct.h> // mkdir # include <direct.h> // mkdir
# include <psapi.h> // GetProcessMemoryInfo # include <psapi.h> // GetProcessMemoryInfo
# include <thread> # 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 #else
# include <sys/time.h> # include <sys/time.h>
# include <sys/wait.h> // Needed on FreeBSD for WIFEXITED # include <sys/wait.h> // Needed on FreeBSD for WIFEXITED