Add wrappers for ExitProcess, TerminateProcess

Christopher Faylor
Tue Oct 6 19:35:00 GMT 2009

On Tue, Oct 06, 2009 at 02:45:22PM -0400, Charles Wilson wrote:
>Christopher Faylor wrote:
>> Looks good with a minor kvetch: Could you use "bool" instead of "BOOL"
>> for variables that don't have to be passed to a Windows function that
>> takes a BOOL argument?
>For the static function exit_process(), sure. But the argument list
>accepted by cygwin_internal() should be C-compatible, shouldn't it? So,
>how about the following?

"bool" is C-compatible.  You just have to #include <stdbool.h> .

But now that you mention it, I wonder if we really should have to
require an #include <windows.h> to use this.  Maybe it should just
be unsigned long.


>static void exit_process (UINT, bool) __attribute__((noreturn));
>static void
>exit_process (UINT status, bool useTerminateProcess)
>      case CW_EXIT_PROCESS:
>        {
>          UINT status = va_arg (arg, UINT);
>          BOOL useTerminateProcess = va_arg (arg, BOOL);
>          exit_process (status, !!useTerminateProcess); /* no return */
>        }

More information about the Cygwin-patches mailing list