From a13ff1f24cc4b01b8756501948b31b8b6b325c02 Mon Sep 17 00:00:00 2001 From: Mickael Savinaud <mickael.savinaud@c-s.fr> Date: Mon, 8 Dec 2014 18:33:10 +0100 Subject: [PATCH] COMP: fix compilation of BandMath example according to the version of muparser --- Examples/BasicFilters/BandMathFilterExample.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Examples/BasicFilters/BandMathFilterExample.cxx b/Examples/BasicFilters/BandMathFilterExample.cxx index 47a2920ee6..5c46a12746 100644 --- a/Examples/BasicFilters/BandMathFilterExample.cxx +++ b/Examples/BasicFilters/BandMathFilterExample.cxx @@ -158,6 +158,13 @@ int main( int argc, char* argv[]) // Software Guide : BeginCodeSnippet filter->SetExpression("if((b4-b3)/(b4+b3) > 0.4, 255, 0)"); + + #ifdef OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS + filter->SetExpression("((b4-b3)/(b4+b3) > 0.4) ? 255 : 0"); + #else + filter->SetExpression("if((b4-b3)/(b4+b3) > 0.4, 255, 0)"); + #endif + // Software Guide : EndCodeSnippet // Software Guide : BeginLatex -- GitLab