What is this source file using <wait.h> for anyway ?
The other code you've changed below has nothing to do with it; if it still compiles on MinGW without <wait.h>, I have to at least entertain the possibility that Unix doesn't need <wait.h> either !