Compatibility fix with MATLAB ≤ R2011a
parent
f4b95d3aa5
commit
58adbdeddd
|
@ -1716,11 +1716,12 @@ DynamicModel::writeDynamicCFile(const string &basename, const int order) const
|
||||||
<< " */" << endl
|
<< " */" << endl
|
||||||
<< "#include <math.h>" << endl;
|
<< "#include <math.h>" << endl;
|
||||||
|
|
||||||
|
mDynamicModelFile << "#include <stdlib.h>" << endl;
|
||||||
|
|
||||||
if (external_functions_table.get_total_number_of_unique_model_block_external_functions())
|
if (external_functions_table.get_total_number_of_unique_model_block_external_functions())
|
||||||
// External Matlab function, implies Dynamic function will call mex
|
// External Matlab function, implies Dynamic function will call mex
|
||||||
mDynamicModelFile << "#include \"mex.h\"" << endl;
|
mDynamicModelFile << "#include <uchar.h>" << endl // For MATLAB ≤ R2011a
|
||||||
else
|
<< "#include \"mex.h\"" << endl;
|
||||||
mDynamicModelFile << "#include <stdlib.h>" << endl;
|
|
||||||
|
|
||||||
mDynamicModelFile << "#define max(a, b) (((a) > (b)) ? (a) : (b))" << endl
|
mDynamicModelFile << "#define max(a, b) (((a) > (b)) ? (a) : (b))" << endl
|
||||||
<< "#define min(a, b) (((a) > (b)) ? (b) : (a))" << endl;
|
<< "#define min(a, b) (((a) > (b)) ? (b) : (a))" << endl;
|
||||||
|
@ -1756,6 +1757,7 @@ DynamicModel::writeDynamicCFile(const string &basename, const int order) const
|
||||||
<< " */" << endl
|
<< " */" << endl
|
||||||
<< endl
|
<< endl
|
||||||
<< "#include <stdlib.h>" << endl
|
<< "#include <stdlib.h>" << endl
|
||||||
|
<< "#include <uchar.h>" << endl // For MATLAB ≤ R2011a
|
||||||
<< "#include \"mex.h\"" << endl
|
<< "#include \"mex.h\"" << endl
|
||||||
<< endl
|
<< endl
|
||||||
<< "const int ntt = " << ntt << ";" << endl
|
<< "const int ntt = " << ntt << ";" << endl
|
||||||
|
|
|
@ -2026,11 +2026,12 @@ StaticModel::writeStaticCFile(const string &basename) const
|
||||||
<< " */" << endl
|
<< " */" << endl
|
||||||
<< "#include <math.h>" << endl;
|
<< "#include <math.h>" << endl;
|
||||||
|
|
||||||
|
output << "#include <stdlib.h>" << endl;
|
||||||
|
|
||||||
if (external_functions_table.get_total_number_of_unique_model_block_external_functions())
|
if (external_functions_table.get_total_number_of_unique_model_block_external_functions())
|
||||||
// External Matlab function, implies Static function will call mex
|
// External Matlab function, implies Static function will call mex
|
||||||
output << "#include \"mex.h\"" << endl;
|
output << "#include <uchar.h>" << endl // For MATLAB ≤ R2011a
|
||||||
else
|
<< "#include \"mex.h\"" << endl;
|
||||||
output << "#include <stdlib.h>" << endl;
|
|
||||||
|
|
||||||
output << "#define max(a, b) (((a) > (b)) ? (a) : (b))" << endl
|
output << "#define max(a, b) (((a) > (b)) ? (a) : (b))" << endl
|
||||||
<< "#define min(a, b) (((a) > (b)) ? (b) : (a))" << endl;
|
<< "#define min(a, b) (((a) > (b)) ? (b) : (a))" << endl;
|
||||||
|
@ -2065,6 +2066,7 @@ StaticModel::writeStaticCFile(const string &basename) const
|
||||||
<< " */" << endl
|
<< " */" << endl
|
||||||
<< endl
|
<< endl
|
||||||
<< "#include <stdlib.h>" << endl
|
<< "#include <stdlib.h>" << endl
|
||||||
|
<< "#include <uchar.h>" << endl // For MATLAB ≤ R2011a
|
||||||
<< "#include \"mex.h\"" << endl
|
<< "#include \"mex.h\"" << endl
|
||||||
<< endl
|
<< endl
|
||||||
<< "const int ntt = " << ntt << ";" << endl
|
<< "const int ntt = " << ntt << ";" << endl
|
||||||
|
|
Loading…
Reference in New Issue