Skip to content

Commit

Permalink
Fix WIFEXITED missing from MinGW/MSYS2 (#2609)
Browse files Browse the repository at this point in the history
* WIFEXITED missing from MinGW/MSYS2, added defines

* Found source of the WIFEXITED macro in the binutils-gdb repo. Now with less pointer manipulation.
  • Loading branch information
thebrave committed Oct 27, 2020
1 parent 34b8ed4 commit 77ac9bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ James Hutchinson
Jamey Hicks
James Pallister
Jan Van Winkel
Jean Berniolles
Jeremy Bennett
John Coiner
John Demme
Expand Down
8 changes: 8 additions & 0 deletions src/V3Os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 77ac9bf

Please sign in to comment.