From 2c94a4ff9d5f3a65e5bedffd6e6d96402241cc20 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Fri, 14 Oct 2016 13:59:36 +0200
Subject: [PATCH] preprocessor: fix bug introduced in
 4255be00b8a10226470c4cc1bc5a514ce37041bc. Normcdf is not supported by MSVC

---
 preprocessor/ModFile.cc | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index b4310fc871..3ee5612f9b 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -737,13 +737,14 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
           cerr << "ERROR: atanh() function is not supported with USE_DLL option and older MSVC compilers; use Cygwin, MinGW or upgrade your MSVC compiler to 11.0 (2012) or later." << endl;
           exit(EXIT_FAILURE);
         }
-      if (dynamic_model.isTrinaryOpUsed(oNormcdf))
-        {
-          cerr << "ERROR: normcdf() function is not supported with USE_DLL option and older MSVC compilers; use Cygwin, MinGW or upgrade your MSVC compiler to 11.0 (2012) or later." << endl;
-          exit(EXIT_FAILURE);
-        }
     }
 #endif
+  if (use_dll && msvc)
+    if (dynamic_model.isTrinaryOpUsed(oNormcdf))
+      {
+        cerr << "ERROR: normcdf() function is not supported with USE_DLL option and older MSVC compilers; use Cygwin, MinGW or upgrade your MSVC compiler to 11.0 (2012) or later." << endl;
+        exit(EXIT_FAILURE);
+      }
 #endif
 
   // Compile the dynamic MEX file for use_dll option
-- 
GitLab