Skip to content

Commit

Permalink
fix duplicate colon matlab error identifiers
Browse files Browse the repository at this point in the history
Matlab error IDs must consist only of words and single colon separators,
but runtime errors that get passed up the chain currently use a double
colon (SWIG::RuntimeError) which causes Matlab to complain:

"The error message identifier is invalid."

The fix is to remove the duplicate colon
  • Loading branch information
rdeits committed Jan 5, 2016
1 parent de0c52d commit cc2e917
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Modules/matlab.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@ int MATLAB::top(Node *n) {
Iterator i = First(l_modules);
if (i.item) {
Printf(f_init, "mxArray *id = mxCreateDoubleScalar(double(4)), *error;\n");
Printf(f_init, "if (!id) mexErrMsgIdAndTxt(\"SWIG::RuntimeError\", \"Setup failed\");\n");
Printf(f_init, "if (!id) mexErrMsgIdAndTxt(\"SWIG:RuntimeError\", \"Setup failed\");\n");
for (; i.item; i = Next(i)) {
Printf(f_init, "error = mexCallMATLABWithTrap(0, 0, 1, &id, \"%s\");\n", i.item);
Printf(f_init, "if (error) mexErrMsgIdAndTxt(\"SWIG::RuntimeError\", \"Cannot initialize %s\");\n", i.item);
Printf(f_init, "if (error) mexErrMsgIdAndTxt(\"SWIG:RuntimeError\", \"Cannot initialize %s\");\n", i.item);
Delete(i.item);
}
Printf(f_init, "mxDestroyArray(id);\n");
Expand Down

0 comments on commit cc2e917

Please sign in to comment.