diff --git a/src/DataTree.cc b/src/DataTree.cc
index cdab07024754cb5feccf1106c01e9f19450c2696..f12a2ad19c9cfffa8eae0d0e7005679ae0ce94b4 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 fe4d40b1116cf1475115b1770f34a33af3f9422f..ed8a61e0fcbc8db05053f54e0e1f30c9798e2c3c 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 5717827621da158fb280037b2cdc49204575bb21..3f17bc01355e23c0b4aeaf61382f16c9bd8b26da 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<variable>[=<value>]] [-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 9933f31187a118e95fa200c501b573517d47bd0c..9958aa42f4b24686e597baa5a62503877082c1dc 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 3908276c3d82b9e369be63bd3e1c1b475e6a0356..37222db1fd73aaa4c0b7fd38ab0929eaebc76e58 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 7f5d50dc87c72a4842d65f525cb994254f6ae718..a677e87a31be9bf223aa06cbb0dca3fd5a7887ca 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 fd47cb7542d7b9bc6ac9170349341b960e567439..fc4bbd4202ed1669054ae9e0e88e03487867bd36 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