Add wrappers for ExitProcess, TerminateProcess

Charles Wilson
Tue Oct 6 18:46:00 GMT 2009

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?

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