Skip to content

Commit

Permalink
Update frmts/vrt/vrtexpression.h
Browse files Browse the repository at this point in the history
Co-authored-by: Even Rouault <[email protected]>
  • Loading branch information
dbaston and rouault authored Jan 11, 2025
1 parent 54fd38f commit a924f0d
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions frmts/vrt/vrtexpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,25 +167,34 @@ class MuParserExpression : public MathExpression
#endif

inline std::unique_ptr<MathExpression>
MathExpression::Create(const char *pszExpression, const char *pszDialect)
MathExpression::Create([[maybe_unused]] const char *pszExpression,
const char *pszDialect)
{
CPL_IGNORE_RET_VAL(pszExpression);
CPL_IGNORE_RET_VAL(pszDialect);

#if GDAL_VRT_ENABLE_EXPRTK
if (EQUAL(pszDialect, "exprtk"))
{
#if GDAL_VRT_ENABLE_EXPRTK
return std::make_unique<gdal::ExprtkExpression>(pszExpression);
}
#else
CPLError(CE_Failure, CPLE_IllegalArg,
"Dialect '%s' is not supported by this GDAL build. A GDAL "
"build against exprtk would be needed.", pszDialect);
#endif
#if GDAL_VRT_ENABLE_MUPARSER
if (EQUAL(pszDialect, "muparser"))
}
else if (EQUAL(pszDialect, "muparser"))
{
#if GDAL_VRT_ENABLE_MUPARSER
return std::make_unique<gdal::MuParserExpression>(pszExpression);
}
#else
CPLError(CE_Failure, CPLE_IllegalArg,
"Dialect '%s' is not supported by this GDAL build. A GDAL "
"build against muparser would be needed.", pszDialect);
#endif
CPLError(CE_Failure, CPLE_IllegalArg, "Unknown expression dialect: %s",
pszDialect);
}
else
{
CPLError(CE_Failure, CPLE_IllegalArg, "Unknown expression dialect: %s",
pszDialect);
}
return nullptr;
}

Expand Down

0 comments on commit a924f0d

Please sign in to comment.