Skip to content

Commit

Permalink
[MATLAB] Fixed Matlab name of mex wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeandersson committed Apr 8, 2014
1 parent 4e7a137 commit 8bfbba7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Source/Modules/matlab.cxx
Expand Up @@ -166,16 +166,19 @@ int MATLAB::top(Node *n) {
/* Get the module name */
String *module = Getattr(n, "name");

/* Name the mex function */
mexname=NewString(module);
Append(mexname,"_wrap");

/* Get .h wrapper file name*/
String *hfile = Getattr(n,"outfile_h");

/* Get the .cxx wrapper file name */
String *cxxfile = Getattr(n, "outfile");

/* To get the name the mex function, we remove the suffix */
mexname=NewString(cxxfile);
char *suffix = Strchr(mexname,'.');
char *suffix_end = Char(mexname)+Len(mexname);
while(suffix!=suffix_end) *suffix++ = ' '; // Replace suffix with whitespaces
Chop(mexname); // Remove trailing whitespaces

/* Initialize wrapper .h file seen by MATLAB */
f_wrap_h = NewFile(hfile, "w", SWIG_output_files());
if (!f_wrap_h){
Expand Down

0 comments on commit 8bfbba7

Please sign in to comment.