git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8947
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxProcess *process)
{
// for the sync execution, we return -1 to indicate failure, but for async
wxProcess *process)
{
// for the sync execution, we return -1 to indicate failure, but for async
- // cse we return 0 which is never a valid PID
- long errorRetCode = sync ? -1 : 0;
+ // case we return 0 which is never a valid PID
+ //
+ // we define this as a macro, not a variable, to avoid compiler warnings
+ // about "ERROR_RETURN_CODE value may be clobbered by fork()"
+ #define ERROR_RETURN_CODE ((sync) ? -1 : 0)
- wxCHECK_MSG( *argv, errorRetCode, wxT("can't exec empty command") );
+ wxCHECK_MSG( *argv, ERROR_RETURN_CODE, wxT("can't exec empty command") );
#if wxUSE_UNICODE
int mb_argc = 0;
#if wxUSE_UNICODE
int mb_argc = 0;
+ return ERROR_RETURN_CODE;
+ return ERROR_RETURN_CODE;
+ return ERROR_RETURN_CODE;
}
else if ( pid == 0 ) // we're in child
{
}
else if ( pid == 0 ) // we're in child
{
+#undef ERROR_RETURN_CODE
#undef ARGS_CLEANUP
// ----------------------------------------------------------------------------
#undef ARGS_CLEANUP
// ----------------------------------------------------------------------------