Skip to content

Commit

Permalink
Merge pull request #13577 from drwells/muparser-pimpl
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed May 11, 2022
2 parents 5a2d504 + 75724de commit 34badb5
Show file tree
Hide file tree
Showing 27 changed files with 233 additions and 289 deletions.
6 changes: 0 additions & 6 deletions bundled/muparser_v2_3_3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,3 @@ src/muParserInt.cpp
src/muParserTest.cpp
src/muParserTokenReader.cpp
)

# We do not support (yet) compiling DLLs with MSVC. By default, muParser will
# try to set itself up correctly with __declspec(dllexport). Get around this by
# instructing it to use static linkage, which will define (see muParserFixes.h)
# AP_EXPORT_CXX to nothing.
DEAL_II_ADD_DEFINITIONS(obj_muparser "MUPARSER_STATIC")
3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/include/muParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
\brief Definition of the standard floating point parser.
*/

namespace dealii
{
namespace mu
{
/** \brief Mathematical expressions parser.
Expand All @@ -66,6 +68,7 @@ namespace mu
static int IsVal(const char_type* a_szExpr, int* a_iPos, value_type* a_fVal);
};
} // namespace mu
}

#endif

3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/include/muParserBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
#endif


namespace dealii
{
namespace mu
{
/** \file
Expand Down Expand Up @@ -309,6 +311,7 @@ namespace mu
};

} // namespace mu
}

#if defined(_MSC_VER)
#pragma warning(pop)
Expand Down
3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/include/muParserBytecode.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
*/


namespace dealii
{
namespace mu
{
struct SToken
Expand Down Expand Up @@ -146,6 +148,7 @@ namespace mu
};

} // namespace mu
}

#endif

Expand Down
3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/include/muParserCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
\brief Definition of the parser callback class.
*/

namespace dealii
{
namespace mu
{

Expand Down Expand Up @@ -156,6 +158,7 @@ namespace mu
typedef std::map<string_type, ParserCallback> funmap_type;

} // namespace mu
}

#endif

3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/include/muParserDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
#endif


namespace dealii
{
namespace mu
{
#if defined(_UNICODE)
Expand Down Expand Up @@ -509,6 +511,7 @@ namespace mu
static const string_type ParserVersion = string_type(_T("2.3.3 (Release)"));
static const string_type ParserVersionDate = string_type(_T("20220122"));
} // end of namespace
}

#if defined(_MSC_VER)
#pragma warning(pop)
Expand Down
3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/include/muParserError.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
\brief This file defines the error class used by the parser.
*/

namespace dealii
{
namespace mu
{
/** \brief A class that handles the error messages. */
Expand Down Expand Up @@ -108,6 +110,7 @@ namespace mu
const ParserErrorMsg& m_ErrMsg;
};
} // namespace mu
}

#if defined(_MSC_VER)
#pragma warning(pop)
Expand Down
31 changes: 9 additions & 22 deletions bundled/muparser_v2_3_3/include/muParserFixes.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,16 @@
MUPARSER_LOCAL is used for non-api symbols.
*/

#ifndef MUPARSER_STATIC /* defined if muParser is compiled as a DLL */

#ifdef MUPARSERLIB_EXPORTS /* defined if we are building the muParser DLL (instead of using it) */
#define API_EXPORT_CXX MUPARSER_HELPER_DLL_EXPORT
#else
#define API_EXPORT_CXX MUPARSER_HELPER_DLL_IMPORT
#endif /* MUPARSER_DLL_EXPORTS */
#define MUPARSER_LOCAL MUPARSER_HELPER_DLL_LOCAL

#else /* MUPARSER_STATIC is defined: this means muParser is a static lib. */

#define API_EXPORT_CXX
#define MUPARSER_LOCAL

#endif /* !MUPARSER_STATIC */


#ifdef _WIN32
#define API_EXPORT(TYPE) API_EXPORT_CXX TYPE __cdecl
#else
#define API_EXPORT(TYPE) TYPE
#endif

// deal.II-specific patch: we
// 1) already set up our own flags for static linkage elsewhere
// 2) do not support dynamic linkage with MSVC
// to this end, override muParser's original logic here to unconditionally make
// API_EXPORT(TYPE) the identity function (and other relevant macros empty).
// Since this header is not installed this behavior change is purely internal.
#define API_EXPORT_CXX
#define MUPARSER_LOCAL
#define API_EXPORT(TYPE) TYPE

#endif // include guard

Expand Down
3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/include/muParserInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
*/


namespace dealii
{
namespace mu
{

Expand Down Expand Up @@ -138,6 +140,7 @@ namespace mu
};

} // namespace mu
}

#endif

125 changes: 0 additions & 125 deletions bundled/muparser_v2_3_3/include/muParserStack.h

This file was deleted.

3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/include/muParserTemplateMagic.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "muParserError.h"


namespace dealii
{
namespace mu
{
//-----------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -194,5 +196,6 @@ namespace mu
static constexpr T CONST_E = (T)2.718281828459045235360287;
};
}
}

#endif
3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/include/muParserTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
\brief This file contains the parser test class.
*/

namespace dealii
{
namespace mu
{
/** \brief Namespace for test cases. */
Expand Down Expand Up @@ -286,6 +288,7 @@ namespace mu
};
} // namespace Test
} // namespace mu
}


#if defined(_MSC_VER)
Expand Down
3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/include/muParserToken.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
\brief This file contains the parser token definition.
*/

namespace dealii
{
namespace mu
{
template <std::size_t NbParams> struct TplCallType;
Expand Down Expand Up @@ -516,6 +518,7 @@ namespace mu
}
};
} // namespace mu
}

#if defined(_MSC_VER)
#pragma warning(pop)
Expand Down
3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/include/muParserTokenReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
*/


namespace dealii
{
namespace mu
{
// Forward declaration
Expand Down Expand Up @@ -154,6 +156,7 @@ namespace mu
char_type m_cArgSep; ///< The character used for separating function arguments
};
} // namespace mu
}

#endif

Expand Down
3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/src/muParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ using namespace std;


/** \brief Namespace for mathematical applications. */
namespace dealii
{
namespace mu
{
//---------------------------------------------------------------------------
Expand Down Expand Up @@ -231,3 +233,4 @@ namespace mu
return fRes;
}
} // namespace mu
}
3 changes: 3 additions & 0 deletions bundled/muparser_v2_3_3/src/muParserBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ using namespace std;
\brief This file contains the basic implementation of the muparser engine.
*/

namespace dealii
{
namespace mu
{
std::locale ParserBase::s_locale = std::locale(std::locale::classic(), new change_dec_sep<char_type>('.'));
Expand Down Expand Up @@ -1915,6 +1917,7 @@ namespace mu

}
} // namespace mu
}

#if defined(_MSC_VER)
#pragma warning(pop)
Expand Down

0 comments on commit 34badb5

Please sign in to comment.