Changeset 11943
- Timestamp:
- 04/05/12 14:53:48 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/include/macros.h
r11918 r11943 41 41 /*}}}*/ 42 42 /* MODULEBOOT/MODULEEND {{{1*/ 43 43 44 /*The following macros hide the error exception handling in a matlab module. Just put 44 45 * MODULEBOOT(); and MODULEEND(); at the beginning and end of a module, and c++ exceptions 45 46 * will be trapped. Really nifty!*/ 47 46 48 #ifdef _SERIAL_ 47 49 #ifdef _HAVE_MATLAB_ //{{{2 48 50 #define MODULEBOOT(); ModuleBoot(); \ 49 51 try{ … … 58 60 mexErrMsgTxt(" ");\ 59 61 } 62 #endif //}}} 63 #ifdef _HAVE_PYTHON_ //{{{2 64 #define MODULEBOOT(); ModuleBoot(); \ 65 try{ 60 66 67 #define MODULEEND(); ModuleEnd(); }\ 68 catch(ErrorException &exception){\ 69 exception.Report(); \ 70 return; \ 71 }\ 72 catch (exception& e) {\ 73 _printf_(true,"Standard exception: %s\n",e.what());\ 74 return;\ 75 } 76 #endif //}}} 61 77 #else 62 78 //{{{2 63 79 #define MODULEBOOT(); \ 64 80 try{ … … 73 89 return 1;\ 74 90 } 91 //}}} 92 #endif 93 /*}}}*/ 94 /* WRAPPER {{{1*/ 95 #ifdef _HAVE_MATLAB_ 96 #define WRAPPER(modulename,...) void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) 97 #endif 98 #ifdef _HAVE_PYTHON_ 99 #define WRAPPER(modulename,...) void modulename(__VA_ARGS__) 100 #endif 101 /*}}}*/ 102 /* CHECKARGUMENTS {{{1*/ 103 #ifdef _HAVE_MATLAB_ 104 #define CHECKARGUMENTS(NLHS,NRHS,functionpointer) CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,functionpointer) 105 #endif 106 #ifdef _HAVE_PYTHON_ 107 #define CHECKARGUMENTS(NLHS,NRHS,functionpointer) 75 108 #endif 76 109 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.