Skip to content

Commit

Permalink
[ci] Try to understand weird exprtk bug?
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Nov 15, 2024
1 parent 0175915 commit 5a3edd2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ossia/math/math_expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ struct perlin<T, 1> : public exprtk::ifunction<T>
}
};

static thread_local exprtk::parser<double> g_exprtk_parser
= exprtk::parser<double>{exprtk::parser<double>::settings_store{}};
struct math_expression::impl
{
static inline thread_local exprtk::parser<double> g_exprtk_parser;
rand_gen<double> random;
perlin<double, 1> noise1d;
exprtk::symbol_table<double> syms;
Expand Down Expand Up @@ -189,18 +190,18 @@ bool math_expression::recompile()
{
impl->variables = std::nullopt;

impl->valid = impl->g_exprtk_parser.compile(impl->cur_expr_txt, impl->expr);
impl->valid = g_exprtk_parser.compile(impl->cur_expr_txt, impl->expr);
if(!impl->valid)
{
ossia::logger().error("Error while parsing: {}", impl->g_exprtk_parser.error());
ossia::logger().error("Error while parsing: {}", g_exprtk_parser.error());
}

return impl->valid;
}

std::string math_expression::error() const
{
return impl->g_exprtk_parser.error();
return g_exprtk_parser.error();
}

double math_expression::value()
Expand Down

0 comments on commit 5a3edd2

Please sign in to comment.