While wait4 is not documented for AIX, it is available; however, even on systems where it is available, the system headers do not always provide a declaration of the function.
This patch firstly provides a declaration of wait4 for AIX. Secondly, it provides a wrapper for wait4 to work around issues that occur when using it directly with WNOHANG.
Is this meant to protect against wait4 as a function-like macro or also as an object-like macro? If the former, an alternate approach (see comment below) would work.