From 2ad16f1db3090fe8c3cc9ad6a804b4ae83c06982 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sat, 4 Feb 2012 16:45:26 +0000 Subject: [PATCH] Fix for VS2010 / Matlab 2010a #include compatibility issues --- Cantera/matlab/src/ctfunctions.cpp | 6 ------ Cantera/matlab/src/ctmatutils.h | 8 ++++++++ Cantera/matlab/src/ctmethods.cpp | 6 ------ Cantera/matlab/src/flowdevicemethods.cpp | 7 ------- Cantera/matlab/src/funcmethods.cpp | 6 ------ Cantera/matlab/src/kineticsmethods.cpp | 6 ------ Cantera/matlab/src/mixturemethods.cpp | 6 ------ Cantera/matlab/src/mllogger.h | 3 +-- Cantera/matlab/src/onedimmethods.cpp | 6 ------ Cantera/matlab/src/phasemethods.cpp | 6 ------ Cantera/matlab/src/reactormethods.cpp | 6 ------ Cantera/matlab/src/reactornetmethods.cpp | 6 ------ Cantera/matlab/src/surfmethods.cpp | 7 ------- Cantera/matlab/src/thermomethods.cpp | 6 ------ Cantera/matlab/src/transportmethods.cpp | 5 ----- Cantera/matlab/src/wallmethods.cpp | 6 ------ Cantera/matlab/src/xmlmethods.cpp | 6 ------ 17 files changed, 9 insertions(+), 93 deletions(-) diff --git a/Cantera/matlab/src/ctfunctions.cpp b/Cantera/matlab/src/ctfunctions.cpp index 35de5783b..17780cd25 100644 --- a/Cantera/matlab/src/ctfunctions.cpp +++ b/Cantera/matlab/src/ctfunctions.cpp @@ -4,12 +4,6 @@ #include #include -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include #include #include diff --git a/Cantera/matlab/src/ctmatutils.h b/Cantera/matlab/src/ctmatutils.h index 13bff5054..7b7cb27ba 100755 --- a/Cantera/matlab/src/ctmatutils.h +++ b/Cantera/matlab/src/ctmatutils.h @@ -6,6 +6,14 @@ const double Undef = -999.123; #include +// Workaround for VS2010 and Matlab 2010a. +// mex.h must be included after or another include from +// the standard library which includes . +#if (_MSC_VER >= 1600) && defined(_CHAR16T) +#define CHAR16_T char16_t +#endif +#include "mex.h" + void reportError(); void checkNArgs(const int n, const int nrhs); diff --git a/Cantera/matlab/src/ctmethods.cpp b/Cantera/matlab/src/ctmethods.cpp index 3ca6f10e9..b000f6254 100644 --- a/Cantera/matlab/src/ctmethods.cpp +++ b/Cantera/matlab/src/ctmethods.cpp @@ -11,12 +11,6 @@ #include -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include #include "ctmatutils.h" #include "mllogger.h" diff --git a/Cantera/matlab/src/flowdevicemethods.cpp b/Cantera/matlab/src/flowdevicemethods.cpp index 67655ab0a..08c747449 100644 --- a/Cantera/matlab/src/flowdevicemethods.cpp +++ b/Cantera/matlab/src/flowdevicemethods.cpp @@ -1,14 +1,7 @@ -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include "ctmatutils.h" #include #include - //const double Undef = -999.123; void flowdevicemethods( int nlhs, mxArray *plhs[], diff --git a/Cantera/matlab/src/funcmethods.cpp b/Cantera/matlab/src/funcmethods.cpp index 0ebeb1ef5..d8b9e248c 100644 --- a/Cantera/matlab/src/funcmethods.cpp +++ b/Cantera/matlab/src/funcmethods.cpp @@ -1,9 +1,3 @@ -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include "ctmatutils.h" #include #include diff --git a/Cantera/matlab/src/kineticsmethods.cpp b/Cantera/matlab/src/kineticsmethods.cpp index b1be378cf..60f5ef5e7 100644 --- a/Cantera/matlab/src/kineticsmethods.cpp +++ b/Cantera/matlab/src/kineticsmethods.cpp @@ -1,9 +1,3 @@ -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include "ctmatutils.h" #include diff --git a/Cantera/matlab/src/mixturemethods.cpp b/Cantera/matlab/src/mixturemethods.cpp index 1d0878171..054d894cf 100644 --- a/Cantera/matlab/src/mixturemethods.cpp +++ b/Cantera/matlab/src/mixturemethods.cpp @@ -3,12 +3,6 @@ */ #include -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include #include #include "ctmatutils.h" diff --git a/Cantera/matlab/src/mllogger.h b/Cantera/matlab/src/mllogger.h index a0205b9bc..2f8d6c0a4 100644 --- a/Cantera/matlab/src/mllogger.h +++ b/Cantera/matlab/src/mllogger.h @@ -4,8 +4,7 @@ #ifndef MLLOGGER_H #define MLLOGGER_H -#include "mex.h" -#include +#include "ctmatutils.h" #include "cantera/kernel/logger.h" #include diff --git a/Cantera/matlab/src/onedimmethods.cpp b/Cantera/matlab/src/onedimmethods.cpp index 0c2f8b7db..7ae6335e1 100644 --- a/Cantera/matlab/src/onedimmethods.cpp +++ b/Cantera/matlab/src/onedimmethods.cpp @@ -1,12 +1,6 @@ #include #include -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include "ctmatutils.h" #include diff --git a/Cantera/matlab/src/phasemethods.cpp b/Cantera/matlab/src/phasemethods.cpp index 41d83552c..ca5d19263 100644 --- a/Cantera/matlab/src/phasemethods.cpp +++ b/Cantera/matlab/src/phasemethods.cpp @@ -2,12 +2,6 @@ * @file phasemethods.cpp */ -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include "ctmatutils.h" #include diff --git a/Cantera/matlab/src/reactormethods.cpp b/Cantera/matlab/src/reactormethods.cpp index 3df3bfec7..05e556972 100644 --- a/Cantera/matlab/src/reactormethods.cpp +++ b/Cantera/matlab/src/reactormethods.cpp @@ -2,12 +2,6 @@ * @file reactormethods.cpp */ -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include #include #include "ctmatutils.h" diff --git a/Cantera/matlab/src/reactornetmethods.cpp b/Cantera/matlab/src/reactornetmethods.cpp index d39c08e3d..5ead36ce3 100644 --- a/Cantera/matlab/src/reactornetmethods.cpp +++ b/Cantera/matlab/src/reactornetmethods.cpp @@ -2,12 +2,6 @@ * @file reactornetmethods.cpp */ -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include #include #include "ctmatutils.h" diff --git a/Cantera/matlab/src/surfmethods.cpp b/Cantera/matlab/src/surfmethods.cpp index ff3095709..a79895620 100644 --- a/Cantera/matlab/src/surfmethods.cpp +++ b/Cantera/matlab/src/surfmethods.cpp @@ -1,19 +1,12 @@ #include #include -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include "ctmatutils.h" #include #include using namespace std; - namespace Cantera { void writelog(const std::string& s); } diff --git a/Cantera/matlab/src/thermomethods.cpp b/Cantera/matlab/src/thermomethods.cpp index 396916053..e20b4e38d 100644 --- a/Cantera/matlab/src/thermomethods.cpp +++ b/Cantera/matlab/src/thermomethods.cpp @@ -2,12 +2,6 @@ * @file thermomethods.cpp */ -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include #include "ctmatutils.h" diff --git a/Cantera/matlab/src/transportmethods.cpp b/Cantera/matlab/src/transportmethods.cpp index 3c5894f7c..8b8e8f9d9 100644 --- a/Cantera/matlab/src/transportmethods.cpp +++ b/Cantera/matlab/src/transportmethods.cpp @@ -1,10 +1,5 @@ #include -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" #include #include "ctmatutils.h" diff --git a/Cantera/matlab/src/wallmethods.cpp b/Cantera/matlab/src/wallmethods.cpp index e2b4324e1..eb8474b1f 100644 --- a/Cantera/matlab/src/wallmethods.cpp +++ b/Cantera/matlab/src/wallmethods.cpp @@ -2,12 +2,6 @@ * @file wallmethods.cpp */ -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include #include #include "ctmatutils.h" diff --git a/Cantera/matlab/src/xmlmethods.cpp b/Cantera/matlab/src/xmlmethods.cpp index 5617d4264..d56bb33d6 100644 --- a/Cantera/matlab/src/xmlmethods.cpp +++ b/Cantera/matlab/src/xmlmethods.cpp @@ -2,12 +2,6 @@ * @file xmlmethods.cpp */ -// Workaround for VS2010 and Matlab 2010a -#if (_MSC_VER >= 1600) && defined(_CHAR16T) -#define CHAR16_T char16_t -#endif -#include "mex.h" - #include #include #include "ctmatutils.h"