Commit 262a0eb7 authored by Praetorius, Simon's avatar Praetorius, Simon

workaround for windows macro definitions

parent f9fd642d
...@@ -18,7 +18,7 @@ include_directories(${MUPARSER_INCLUDE_DIR}) ...@@ -18,7 +18,7 @@ include_directories(${MUPARSER_INCLUDE_DIR})
if (ENABLE_CXX11) if (ENABLE_CXX11)
add_definitions(-DMUPARSER_HAS_CXX11=1) add_definitions(-DAMDIS_HAS_CXX11=1)
endif (ENABLE_CXX11) endif (ENABLE_CXX11)
# specify how to install this target: # specify how to install this target:
......
...@@ -18,7 +18,7 @@ target_include_directories(muparser PUBLIC ${MUPARSER_INCLUDE_DIR}) ...@@ -18,7 +18,7 @@ target_include_directories(muparser PUBLIC ${MUPARSER_INCLUDE_DIR})
if (ENABLE_CXX11) if (ENABLE_CXX11)
target_enable_cxx11(MUPARSER_ENABLE_CXX11 muparser PRIVATE) target_enable_cxx11(MUPARSER_ENABLE_CXX11 muparser PRIVATE)
target_compile_definitions(muparser PRIVATE MUPARSER_HAS_CXX11=1) target_compile_definitions(muparser PRIVATE AMDIS_HAS_CXX11=1)
endif (ENABLE_CXX11) endif (ENABLE_CXX11)
# specify how to install this target: # specify how to install this target:
......
...@@ -262,7 +262,7 @@ private: ...@@ -262,7 +262,7 @@ private:
mutable stringbuf_type m_vStringBuf; ///< String buffer, used for storing string function arguments mutable stringbuf_type m_vStringBuf; ///< String buffer, used for storing string function arguments
stringbuf_type m_vStringVarBuf; stringbuf_type m_vStringVarBuf;
#if MUPARSER_HAS_CXX11 #if AMDIS_HAS_CXX11
std::unique_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object. std::unique_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object.
#else #else
std::auto_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object. std::auto_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object.
......
...@@ -78,7 +78,7 @@ namespace mu ...@@ -78,7 +78,7 @@ namespace mu
TString m_strTok; ///< Token string TString m_strTok; ///< Token string
TString m_strVal; ///< Value for string variables TString m_strVal; ///< Value for string variables
value_type m_fVal; value_type m_fVal;
#if MUPARSER_HAS_CXX11 #if AMDIS_HAS_CXX11
std::unique_ptr<ParserCallback> m_pCallback; std::unique_ptr<ParserCallback> m_pCallback;
#else #else
std::auto_ptr<ParserCallback> m_pCallback; std::auto_ptr<ParserCallback> m_pCallback;
......
...@@ -1040,7 +1040,7 @@ namespace mu ...@@ -1040,7 +1040,7 @@ namespace mu
try try
{ {
#if MUPARSER_HAS_CXX11 #if AMDIS_HAS_CXX11
std::unique_ptr<Parser> p1; std::unique_ptr<Parser> p1;
#else #else
std::auto_ptr<Parser> p1; std::auto_ptr<Parser> p1;
......
...@@ -145,7 +145,7 @@ namespace mu ...@@ -145,7 +145,7 @@ namespace mu
*/ */
ParserTokenReader* ParserTokenReader::Clone(ParserBase *a_pParent) const ParserTokenReader* ParserTokenReader::Clone(ParserBase *a_pParent) const
{ {
#if MUPARSER_HAS_CXX11 #if AMDIS_HAS_CXX11
std::unique_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this)); std::unique_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this));
#else #else
std::auto_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this)); std::auto_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this));
......
...@@ -57,6 +57,14 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t; ...@@ -57,6 +57,14 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t;
#undef min #undef min
#endif #endif
#ifdef NONE
#undef NONE
#endif
#ifdef THIS
#undef THIS
#endif
#if MSC_VERSION >= 1800 && !defined(HAS_VARIADIC_TEMPLATES) #if MSC_VERSION >= 1800 && !defined(HAS_VARIADIC_TEMPLATES)
#define HAS_VARIADIC_TEMPLATES 1 #define HAS_VARIADIC_TEMPLATES 1
#endif #endif
......
...@@ -140,7 +140,7 @@ namespace AMDiS { namespace io { ...@@ -140,7 +140,7 @@ namespace AMDiS { namespace io {
macroFilename + ';' + perFilename; macroFilename + ';' + perFilename;
macroFile_nl = macroFile.length(); macroFile_nl = macroFile.length();
} else if (writeMacro == Macroformat::THIS) { } else if (writeMacro == Macroformat::SELF) {
macroFile_nl = 13; macroFile_nl = 13;
readFileToString(macroFilename, macroData); readFileToString(macroFilename, macroData);
...@@ -163,7 +163,7 @@ namespace AMDiS { namespace io { ...@@ -163,7 +163,7 @@ namespace AMDiS { namespace io {
} }
// write macro and periodic file // write macro and periodic file
if (writeMacro == Macroformat::THIS && macroFilename.length()) { if (writeMacro == Macroformat::SELF && macroFilename.length()) {
file.seekp(0, ios_base::end); file.seekp(0, ios_base::end);
long macroPos = file.tellp(), perPos = 0; long macroPos = file.tellp(), perPos = 0;
file.write(macroData.c_str(), macroData.length()); file.write(macroData.c_str(), macroData.length());
...@@ -354,7 +354,7 @@ namespace AMDiS { namespace io { ...@@ -354,7 +354,7 @@ namespace AMDiS { namespace io {
macroFilename + ';' + perFilename; macroFilename + ';' + perFilename;
macroFile_nl = macroFile.length(); macroFile_nl = macroFile.length();
} else if (writeMacro == Macroformat::THIS) { } else if (writeMacro == Macroformat::SELF) {
macroFile_nl = perFilename.length() ? 27 : 13; macroFile_nl = perFilename.length() ? 27 : 13;
macroFile.resize(macroFile_nl, ' '); macroFile.resize(macroFile_nl, ' ');
} }
...@@ -604,7 +604,7 @@ namespace AMDiS { namespace io { ...@@ -604,7 +604,7 @@ namespace AMDiS { namespace io {
//reset the macro positions in file //reset the macro positions in file
setMacrosPos(file, headerLen, macroSize); setMacrosPos(file, headerLen, macroSize);
if (writeMacro == Macroformat::THIS) if (writeMacro == Macroformat::SELF)
setMacroFile(file, headerLen, mesh, writeMacro); setMacroFile(file, headerLen, mesh, writeMacro);
file.close(); file.close();
...@@ -634,8 +634,8 @@ namespace AMDiS { namespace io { ...@@ -634,8 +634,8 @@ namespace AMDiS { namespace io {
{ {
FUNCNAME("setMacroFile()"); FUNCNAME("setMacroFile()");
TEST_EXIT(writeMacro == Macroformat::THIS) TEST_EXIT(writeMacro == Macroformat::SELF)
("This function should only be called under Macroformat::THIS.\n"); ("This function should only be called under Macroformat::SELF.\n");
string macroFilename = "", perFilename = ""; string macroFilename = "", perFilename = "";
string macroData = "", periodicData = ""; string macroData = "", periodicData = "";
......
...@@ -27,7 +27,7 @@ namespace AMDiS { namespace io { ...@@ -27,7 +27,7 @@ namespace AMDiS { namespace io {
typedef enum{ typedef enum{
NONE = 0, // no macro NONE = 0, // no macro
PT_MACROFILE = 1, // pointer to macro file PT_MACROFILE = 1, // pointer to macro file
THIS = 2 // pointer to this file, at the end of this file SELF = 2 // pointer to this file, at the end of this file
} Value; } Value;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment