- extends the error messages in mex_interface (necessary to emulate the mex functions in a standalone mode for debugging purposes)

time-shift
Ferhat Mihoubi 2010-10-11 18:09:31 +02:00
parent f6835d1d61
commit 4b824ad8ed
2 changed files with 12 additions and 2 deletions

View File

@ -321,7 +321,9 @@ mxDuplicateArray(const mxArray *array)
memcpy(Array->data , array->data, Size); memcpy(Array->data , array->data, Size);
break; break;
default: default:
mexErrMsgTxt("Array type not handle"); ostringstream tmp;
tmp << "Array type not handle: " << array->type << "\n";
mexErrMsgTxt(tmp.str());
} }
return(Array); return(Array);
} }
@ -421,7 +423,9 @@ read_Array(FILE *fid)
Array = read_char_array(fid); Array = read_char_array(fid);
break; break;
default: default:
mexErrMsgTxt("Array type not handle in read_Array\n"); ostringstream tmp;
tmp << "Array type not handle in read_Array: " << array_type << "\n";
mexErrMsgTxt(tmp.str());
} }
return(Array); return(Array);
} }

View File

@ -29,6 +29,12 @@
#include <algorithm> #include <algorithm>
using namespace std; using namespace std;
#if !defined(DYN_MEX_FUNC_ERR_MSG_TXT)
#define DYN_MEX_FUNC_ERR_MSG_TXT(str) \
do { \
mexPrintf("%s\n", str); \
} while(0)
#endif
typedef unsigned int mwIndex; typedef unsigned int mwIndex;
typedef unsigned int mwSize; typedef unsigned int mwSize;