diff --git a/src/DataTree.cc b/src/DataTree.cc index cdab0702..f12a2ad1 100644 --- a/src/DataTree.cc +++ b/src/DataTree.cc @@ -759,7 +759,7 @@ DataTree::writePowerDeriv(ostream &output) const void DataTree::writeNormcdfCHeader(ostream &output) const { -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) if (isTrinaryOpUsed(TrinaryOpcode::normcdf)) output << "#ifdef _MSC_VER" << endl << "double normcdf(double);" << endl @@ -770,7 +770,7 @@ DataTree::writeNormcdfCHeader(ostream &output) const void DataTree::writeNormcdf(ostream &output) const { -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) if (isTrinaryOpUsed(TrinaryOpcode::normcdf)) output << endl << "#ifdef _MSC_VER" << endl diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc index fe4d40b1..ed8a61e0 100644 --- a/src/DynamicModel.cc +++ b/src/DynamicModel.cc @@ -1552,7 +1552,7 @@ DynamicModel::writeDynamicCFile(const string &basename, const int order) const << " * Warning : this file is generated automatically by Dynare" << endl << " * from model file (.mod)" << endl << " */" << endl -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) << "#ifdef _MSC_VER" << endl << "#define _USE_MATH_DEFINES" << endl << "#endif" << endl diff --git a/src/DynareMain.cc b/src/DynareMain.cc index 57178276..3f17bc01 100644 --- a/src/DynareMain.cc +++ b/src/DynareMain.cc @@ -42,7 +42,7 @@ void main2(stringstream &in, string &basename, bool debug, bool clear_all, bool WarningConsolidation &warnings_arg, bool nostrict, bool stochastic, bool check_model_changes, bool minimal_workspace, bool compute_xrefs, FileOutputType output_mode, LanguageOutputType lang, int params_derivs_order, bool transform_unary_ops -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) , bool cygwin, bool msvc, bool mingw #endif , JsonOutputPointType json, JsonFileOutputType json_output_mode, bool onlyjson, bool jsonderivsimple @@ -59,7 +59,7 @@ usage() << " [console] [nograph] [nointeractive] [parallel[=cluster_name]] [conffile=parallel_config_path_and_filename] [parallel_slave_open_mode] [parallel_test]" << " [-D[=]] [-I/path] [nostrict] [stochastic] [fast] [minimal_workspace] [compute_xrefs] [output=dynamic|first|second|third] [language=julia]" << " [params_derivs_order=0|1|2] [transform_unary_ops]" -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) << " [cygwin] [msvc] [mingw]" #endif << " [json=parse|check|transform|compute] [jsonstdout] [onlyjson] [jsonderivsimple] [nopathchange] [nopreprocessoroutput]" @@ -99,7 +99,7 @@ main(int argc, char **argv) bool console = false; bool nograph = false; bool nointeractive = false; -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) bool cygwin = false; bool msvc = false; bool mingw = false; @@ -180,7 +180,7 @@ main(int argc, char **argv) nograph = true; else if (!strcmp(argv[arg], "nointeractive")) nointeractive = true; -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) else if (!strcmp(argv[arg], "cygwin")) cygwin = true; else if (!strcmp(argv[arg], "msvc")) @@ -401,7 +401,7 @@ main(int argc, char **argv) no_tmp_terms, no_log, no_warn, warn_uninit, console, nograph, nointeractive, parallel, config_file, warnings, nostrict, stochastic, check_model_changes, minimal_workspace, compute_xrefs, output_mode, language, params_derivs_order, transform_unary_ops -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) , cygwin, msvc, mingw #endif , json, json_output_mode, onlyjson, jsonderivsimple, nopreprocessoroutput diff --git a/src/DynareMain2.cc b/src/DynareMain2.cc index 9933f311..9958aa42 100644 --- a/src/DynareMain2.cc +++ b/src/DynareMain2.cc @@ -33,7 +33,7 @@ main2(stringstream &in, string &basename, bool debug, bool clear_all, bool clear WarningConsolidation &warnings, bool nostrict, bool stochastic, bool check_model_changes, bool minimal_workspace, bool compute_xrefs, FileOutputType output_mode, LanguageOutputType language, int params_derivs_order, bool transform_unary_ops -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) , bool cygwin, bool msvc, bool mingw #endif , JsonOutputPointType json, JsonFileOutputType json_output_mode, bool onlyjson, bool jsonderivsimple @@ -73,7 +73,7 @@ main2(stringstream &in, string &basename, bool debug, bool clear_all, bool clear else mod_file->writeOutputFiles(basename, clear_all, clear_global, no_log, no_warn, console, nograph, nointeractive, config_file, check_model_changes, minimal_workspace, compute_xrefs -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) , cygwin, msvc, mingw #endif , nopreprocessoroutput diff --git a/src/ModFile.cc b/src/ModFile.cc index 3908276c..37222db1 100644 --- a/src/ModFile.cc +++ b/src/ModFile.cc @@ -983,7 +983,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo // When check_model_changes is true, don't force compile if MEX is fresher than source if (use_dll) { -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) if (msvc) // MATLAB/Windows + Microsoft Visual C++ mOutputFile << "dyn_mex('msvc', '" << basename << "', " << !check_model_changes << ")" << endl; diff --git a/src/ModFile.hh b/src/ModFile.hh index 7f5d50dc..a677e87a 100644 --- a/src/ModFile.hh +++ b/src/ModFile.hh @@ -163,7 +163,7 @@ public: void writeOutputFiles(const string &basename, bool clear_all, bool clear_global, bool no_log, bool no_warn, bool console, bool nograph, bool nointeractive, const ConfigFile &config_file, bool check_model_changes, bool minimal_workspace, bool compute_xrefs -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) , bool cygwin, bool msvc, bool mingw #endif , const bool nopreprocessoroutput diff --git a/src/StaticModel.cc b/src/StaticModel.cc index fd47cb75..fc4bbd42 100644 --- a/src/StaticModel.cc +++ b/src/StaticModel.cc @@ -1881,7 +1881,7 @@ StaticModel::writeStaticCFile(const string &basename) const << " * Warning : this file is generated automatically by Dynare" << endl << " * from model file (.mod)" << endl << endl << " */" << endl -#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__CYGWIN32__) << "#ifdef _MSC_VER" << endl << "#define _USE_MATH_DEFINES" << endl << "#endif" << endl