From: Matthias Maier Date: Thu, 14 Nov 2019 04:38:54 +0000 (-0600) Subject: fix compilation with opencascade version 6.8.0 and older X-Git-Tag: v9.2.0-rc1~877^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9048%2Fhead;p=dealii.git fix compilation with opencascade version 6.8.0 and older --- diff --git a/source/opencascade/utilities.cc b/source/opencascade/utilities.cc index c000c31730..42229eea32 100644 --- a/source/opencascade/utilities.cc +++ b/source/opencascade/utilities.cc @@ -335,16 +335,24 @@ namespace OpenCASCADE } StlAPI_Writer writer; - const auto error = writer.Write(shape_to_be_written, filename.c_str()); + # if ((OCC_VERSION_MAJOR * 100 + OCC_VERSION_MINOR * 10) >= 690) + // opencascade versions 6.9.0 onwards return an error status + const auto error = writer.Write(shape_to_be_written, filename.c_str()); + // which is a custom type between 6.9.0 and 7.1.0 # if ((OCC_VERSION_MAJOR * 100 + OCC_VERSION_MINOR * 10) < 720) AssertThrow(error == StlAPI_StatusOK, ExcMessage("Error writing STL from shape.")); # else + // and a boolean from version 7.2.0 onwards AssertThrow(error == true, ExcMessage("Error writing STL from shape.")); # endif +# else + + // for opencascade versions 6.8.0 and older the return value is void + writer.Write(shape_to_be_written, filename.c_str()); # endif }