From 70112b7315bec504a61b65077f83f1d71f40df65 Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Mon, 6 May 2019 18:03:48 +0200 Subject: [PATCH] Fixed a name clash that sometimes occurred when compiling Storm on macOS with TBB. --- src/storm/adapters/RationalFunctionAdapter.h | 31 ++++++++++++++++++++ src/storm/analysis/GraphConditions.h | 15 ++-------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/storm/adapters/RationalFunctionAdapter.h b/src/storm/adapters/RationalFunctionAdapter.h index f403103f5..39490d81e 100644 --- a/src/storm/adapters/RationalFunctionAdapter.h +++ b/src/storm/adapters/RationalFunctionAdapter.h @@ -9,6 +9,27 @@ #include #include +// Some header files on macOS (included via INTEL TBB) might #define TRUE and FALSE, which in carl/formula/Formula.h are used as FormulaTypes. +// Hence, we temporarily #undef these: +#ifdef TRUE +#define STORM_TEMP_TRUE TRUE +#undef TRUE +#endif +#ifdef FALSE +#define STORM_TEMP_FALSE FALSE +#undef FALSE +#endif +#include +// Restore TRUE / FALSE macros. +#ifdef STORM_TEMP_TRUE +#define TRUE STORM_TEMP_TRUE +#undef STORM_TEMP_TRUE +#endif +#ifdef STORM_TEMP_FALSE +#define FALSE STORM_TEMP_FALSE +#undef STORM_TEMP_FALSE +#endif + namespace carl { // Define hash values for all polynomials and rational function. template @@ -57,5 +78,15 @@ namespace storm { typedef carl::RationalFunction RationalFunction; typedef carl::Interval Interval; + + template + struct ConstraintType { + typedef void* val; + }; + + template + struct ConstraintType::value>::type> { + typedef carl::Formula val; + }; } diff --git a/src/storm/analysis/GraphConditions.h b/src/storm/analysis/GraphConditions.h index a901dfa68..04b5d7774 100644 --- a/src/storm/analysis/GraphConditions.h +++ b/src/storm/analysis/GraphConditions.h @@ -4,21 +4,10 @@ #include #include "storm/adapters/RationalFunctionAdapter.h" #include "storm/models/sparse/Dtmc.h" -#include namespace storm { namespace analysis { - template - struct ConstraintType { - typedef void* val; - }; - - template - struct ConstraintType::value>::type> { - typedef carl::Formula val; - }; - /** * Class to collect constraints on parametric Markov chains. */ @@ -26,11 +15,11 @@ namespace storm { class ConstraintCollector { private: // A set of constraints that says that the DTMC actually has valid probability distributions in all states. - std::unordered_set::val> wellformedConstraintSet; + std::unordered_set::val> wellformedConstraintSet; // A set of constraints that makes sure that the underlying graph of the model does not change depending // on the parameter values. - std::unordered_set::val> graphPreservingConstraintSet; + std::unordered_set::val> graphPreservingConstraintSet; // A set of variables std::set variableSet;