Skip to content

Commit

Permalink
WIFEXITED missing from MinGW/MSYS2, added defines
Browse files Browse the repository at this point in the history
  • Loading branch information
thebrave committed Oct 27, 2020
1 parent 95d1272 commit 0a14a0d
Show file tree
Hide file tree
Showing 2 changed files with 19 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
18 changes: 18 additions & 0 deletions src/V3Os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@
# include <direct.h> // mkdir
# include <psapi.h> // GetProcessMemoryInfo
# include <thread>
# ifndef WIFEXITED
# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xC0000000) == 0)
# endif
# ifndef WEXITSTATUS
# define WEXITSTATUS(stat) (*((int *) &(stat)))
# endif
# ifndef WIFSIGNALED
# define WIFSIGNALED(stat) ((*((int *) &(stat))) & 0xC0000000)
# endif
# ifndef WTERMSIG
# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7f)
# endif
# ifndef WIFSTOPPED
# define WIFSTOPPED(stat) 0
# endif
# ifndef WSTOPSIG
# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xff)
# endif
#else
# include <sys/time.h>
# include <sys/wait.h> // Needed on FreeBSD for WIFEXITED
Expand Down

0 comments on commit 0a14a0d

Please sign in to comment.