This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: Add wrappers for ExitProcess, TerminateProcess
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.
cgf
>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 */
> }
>
>--
>Chuck
>
- References:
- Add wrappers for ExitProcess, TerminateProcess
- Re: Add wrappers for ExitProcess, TerminateProcess
- Re: Add wrappers for ExitProcess, TerminateProcess
- Re: Add wrappers for ExitProcess, TerminateProcess
- Re: Add wrappers for ExitProcess, TerminateProcess
- Re: Add wrappers for ExitProcess, TerminateProcess
- Re: Add wrappers for ExitProcess, TerminateProcess
- Re: Add wrappers for ExitProcess, TerminateProcess
- Re: Add wrappers for ExitProcess, TerminateProcess
- Re: Add wrappers for ExitProcess, TerminateProcess