From 7e6b232978290739339f9117c2e523a0c6a2a103 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 3 Feb 2012 22:54:33 +0000 Subject: [PATCH] Workaround for char16_t definition when using Matlab2010a and VS2010 --- Cantera/matlab/src/ctfunctions.cpp | 11 +++++++++-- Cantera/matlab/src/ctmethods.cpp | 8 +++++++- Cantera/matlab/src/flowdevicemethods.cpp | 6 +++++- Cantera/matlab/src/funcmethods.cpp | 6 +++++- Cantera/matlab/src/kineticsmethods.cpp | 6 +++++- Cantera/matlab/src/mixturemethods.cpp | 8 +++++++- Cantera/matlab/src/onedimmethods.cpp | 9 +++++++-- Cantera/matlab/src/phasemethods.cpp | 6 ++++++ Cantera/matlab/src/reactormethods.cpp | 6 ++++++ Cantera/matlab/src/reactornetmethods.cpp | 6 ++++++ Cantera/matlab/src/surfmethods.cpp | 9 +++++++-- Cantera/matlab/src/thermomethods.cpp | 6 ++++++ Cantera/matlab/src/transportmethods.cpp | 6 +++++- Cantera/matlab/src/wallmethods.cpp | 6 ++++++ Cantera/matlab/src/xmlmethods.cpp | 6 ++++++ 15 files changed, 93 insertions(+), 12 deletions(-) diff --git a/Cantera/matlab/src/ctfunctions.cpp b/Cantera/matlab/src/ctfunctions.cpp index e2a783473..35de5783b 100644 --- a/Cantera/matlab/src/ctfunctions.cpp +++ b/Cantera/matlab/src/ctfunctions.cpp @@ -1,13 +1,20 @@ /** * @file ctfunctions.cpp */ +#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 #include "ctmatutils.h" -#include -#include + using namespace std; void reportError() { diff --git a/Cantera/matlab/src/ctmethods.cpp b/Cantera/matlab/src/ctmethods.cpp index 8cc2ae7d0..3ca6f10e9 100644 --- a/Cantera/matlab/src/ctmethods.cpp +++ b/Cantera/matlab/src/ctmethods.cpp @@ -9,9 +9,15 @@ * class is indicated by the first parameter in the call from MATLAB. */ -#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 "ctmatutils.h" #include "mllogger.h" diff --git a/Cantera/matlab/src/flowdevicemethods.cpp b/Cantera/matlab/src/flowdevicemethods.cpp index 30109ca40..67655ab0a 100644 --- a/Cantera/matlab/src/flowdevicemethods.cpp +++ b/Cantera/matlab/src/flowdevicemethods.cpp @@ -1,5 +1,9 @@ - +// 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/funcmethods.cpp b/Cantera/matlab/src/funcmethods.cpp index da55888c7..0ebeb1ef5 100644 --- a/Cantera/matlab/src/funcmethods.cpp +++ b/Cantera/matlab/src/funcmethods.cpp @@ -1,5 +1,9 @@ - +// 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 b4c571483..b1be378cf 100644 --- a/Cantera/matlab/src/kineticsmethods.cpp +++ b/Cantera/matlab/src/kineticsmethods.cpp @@ -1,5 +1,9 @@ - +// 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 aa2a18d3d..1d0878171 100644 --- a/Cantera/matlab/src/mixturemethods.cpp +++ b/Cantera/matlab/src/mixturemethods.cpp @@ -1,11 +1,17 @@ /** * @file mixturemethods.cpp */ +#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" -#include using namespace std; void mixturemethods( int nlhs, mxArray *plhs[], diff --git a/Cantera/matlab/src/onedimmethods.cpp b/Cantera/matlab/src/onedimmethods.cpp index 17126e2c0..0c2f8b7db 100644 --- a/Cantera/matlab/src/onedimmethods.cpp +++ b/Cantera/matlab/src/onedimmethods.cpp @@ -1,10 +1,15 @@ +#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 -#include using namespace std; diff --git a/Cantera/matlab/src/phasemethods.cpp b/Cantera/matlab/src/phasemethods.cpp index 86e42a7ef..41d83552c 100644 --- a/Cantera/matlab/src/phasemethods.cpp +++ b/Cantera/matlab/src/phasemethods.cpp @@ -1,7 +1,13 @@ /** * @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 73bf3cd9b..3df3bfec7 100644 --- a/Cantera/matlab/src/reactormethods.cpp +++ b/Cantera/matlab/src/reactormethods.cpp @@ -1,7 +1,13 @@ /** * @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 68887c4c3..d39c08e3d 100644 --- a/Cantera/matlab/src/reactornetmethods.cpp +++ b/Cantera/matlab/src/reactornetmethods.cpp @@ -1,7 +1,13 @@ /** * @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 8af7b4e89..ff3095709 100644 --- a/Cantera/matlab/src/surfmethods.cpp +++ b/Cantera/matlab/src/surfmethods.cpp @@ -1,11 +1,16 @@ +#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 -#include -#include using namespace std; diff --git a/Cantera/matlab/src/thermomethods.cpp b/Cantera/matlab/src/thermomethods.cpp index 74cde4f6b..396916053 100644 --- a/Cantera/matlab/src/thermomethods.cpp +++ b/Cantera/matlab/src/thermomethods.cpp @@ -1,7 +1,13 @@ /** * @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 5a286c48d..3c5894f7c 100644 --- a/Cantera/matlab/src/transportmethods.cpp +++ b/Cantera/matlab/src/transportmethods.cpp @@ -1,8 +1,12 @@ +#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 void reportError(); diff --git a/Cantera/matlab/src/wallmethods.cpp b/Cantera/matlab/src/wallmethods.cpp index 7c0a15037..e2b4324e1 100644 --- a/Cantera/matlab/src/wallmethods.cpp +++ b/Cantera/matlab/src/wallmethods.cpp @@ -1,7 +1,13 @@ /** * @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 32cf4d4c1..5617d4264 100644 --- a/Cantera/matlab/src/xmlmethods.cpp +++ b/Cantera/matlab/src/xmlmethods.cpp @@ -1,7 +1,13 @@ /** * @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"