Made ctrl+c detection in a mex file work more reliably in newer versions of

matlab.
This commit is contained in:
Davis King 2017-07-06 10:04:02 -04:00
parent 26524fe7a1
commit 917dcad316

View File

@ -3050,12 +3050,12 @@ namespace mex_binding
int num = static_cast<int>(pptr()-pbase());
if (num != 0)
{
check_for_matlab_ctrl_c();
buf[num] = 0; // null terminate the string
mexPrintf("%s",&buf[0]);
mexEvalString("drawnow"); // flush print to screen
pbump(-num);
check_for_matlab_ctrl_c();
}
return 0;
}
@ -3108,12 +3108,12 @@ namespace mex_binding
int num = static_cast<int>(pptr()-pbase());
if (num != 0)
{
check_for_matlab_ctrl_c();
buf[num] = 0; // null terminate the string
mexWarnMsgTxt(&buf[0]);
mexEvalString("drawnow"); // flush print to screen
pbump(-num);
check_for_matlab_ctrl_c();
}
return 0;
}