From 6f45ec66ad618507a1b7010c8a653b1489e36d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien.villemot@ens.fr> Date: Tue, 23 Feb 2010 16:56:15 +0100 Subject: [PATCH] Preprocessor: add error message when using USE_DLL with MSVC and some function unsupported by MSVC (cherry picked from commit 38b8ccf52dcbf6d343aa8321a9c0296c4255c4b4) --- preprocessor/ModFile.cc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc index 8f52e47755..7bd8eb1c79 100644 --- a/preprocessor/ModFile.cc +++ b/preprocessor/ModFile.cc @@ -296,6 +296,33 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all if (!use_dll) mOutputFile << "erase_compiled_function('" + basename + "_dynamic');" << endl; +#if defined(_WIN32) || defined(__CYGWIN32__) + // If using USE_DLL with MSVC, check that the user didn't use a function not supported by MSVC (because MSVC doesn't comply with C99 standard) + if (use_dll && msvc) + { + if (dynamic_model.isUnaryOpUsed(oAcosh)) + { + cerr << "ERROR: acosh() function is not supported with USE_DLL option and MSVC compiler; use Cygwin compiler instead." << endl; + exit(EXIT_FAILURE); + } + if (dynamic_model.isUnaryOpUsed(oAsinh)) + { + cerr << "ERROR: asinh() function is not supported with USE_DLL option and MSVC compiler; use Cygwin compiler instead." << endl; + exit(EXIT_FAILURE); + } + if (dynamic_model.isUnaryOpUsed(oAtanh)) + { + cerr << "ERROR: atanh() function is not supported with USE_DLL option and MSVC compiler; use Cygwin compiler instead." << endl; + exit(EXIT_FAILURE); + } + if (dynamic_model.isTrinaryOpUsed(oNormcdf)) + { + cerr << "ERROR: normcdf() function is not supported with USE_DLL option and MSVC compiler; use Cygwin compiler instead." << endl; + exit(EXIT_FAILURE); + } + } +#endif + // Compile the dynamic MEX file for use_dll option if (use_dll) { -- GitLab