diff --git a/geom/geocad/inc/TGeoToOCC.h b/geom/geocad/inc/TGeoToOCC.h index 42361514beb0fcdd20f6c7c89200445bfb746cf2..100874153de9f4f714431c840179b623ff7dcea0 100644 --- a/geom/geocad/inc/TGeoToOCC.h +++ b/geom/geocad/inc/TGeoToOCC.h @@ -12,6 +12,14 @@ #ifndef ROOT_TGeoToOCC #define ROOT_TGeoToOCC +// ROOT-9837: manage the macro called Handle defined +// in the Standard_Macro.hxx file. The name `Handle` +// cannot leak out of these headers otherwise name +// clashes will occour. +#ifndef Handle +#define Handle(ClassName) Handle_##ClassName +#endif + //Cascade #include <Standard_Version.hxx> @@ -58,6 +66,12 @@ public: TopoDS_Shape Reverse(TopoDS_Shape Shape); }; + +// ROOT-9837 +#ifdef Handle +#undef Handle +#endif + #endif diff --git a/geom/geocad/inc/TOCCToStep.h b/geom/geocad/inc/TOCCToStep.h index f03bc46b35ccc3b1b724f605d9da2ef2611f1c14..bd90903f6c124045411eb2a88ab886e49cb51f44 100644 --- a/geom/geocad/inc/TOCCToStep.h +++ b/geom/geocad/inc/TOCCToStep.h @@ -16,6 +16,14 @@ #include "TGeoMatrix.h" #include "TGeoToOCC.h" +// ROOT-9837: manage the macro called Handle defined +// in the Standard_Macro.hxx file. The name `Handle` +// cannot leak out of these headers otherwise name +// clashes will occour. +#ifndef Handle +#define Handle(ClassName) Handle_##ClassName +#endif + #include <TDF_Label.hxx> #include <XCAFDoc_ShapeTool.hxx> #include <TDocStd_Document.hxx> @@ -32,7 +40,7 @@ private: STEPCAFControl_Writer fWriter; //the step file pointer Handle(TDocStd_Document) fDoc; //the step document element - // The following probably shouldn't be data members. + // The following probably shouldn't be data members. LabelMap_t fTree; //tree of Label's volumes TDF_Label fLabel; //label of the OCC shape element TGeoToOCC fRootShape; @@ -59,4 +67,9 @@ public: void OCCWriteStep(const char *fname); }; +// ROOT-9837 +#ifdef Handle +#undef Handle +#endif + #endif diff --git a/geom/geocad/src/TGeoToOCC.cxx b/geom/geocad/src/TGeoToOCC.cxx index c4fde2fab80ef635607b609a7fbd27b0e4ebe42a..10263475c01c5af1b707f9458dc9938c2246a19e 100644 --- a/geom/geocad/src/TGeoToOCC.cxx +++ b/geom/geocad/src/TGeoToOCC.cxx @@ -45,7 +45,12 @@ A log file is created in `/tmp/TGeoCad.log` */ #include "TGeoToOCC.h" - +// ROOT-9837: the macro `Handle` has been undefined +// we need to redefine it as it is done in the oce +// header Standard_Macro.hxx +#ifndef Handle +#define Handle(ClassName) Handle_##ClassName +#endif //Cascade diff --git a/geom/geocad/src/TGeoToStep.cxx b/geom/geocad/src/TGeoToStep.cxx index 6b18b4a218ecb67d67cbf148a2eb13c18bdfb305..2909198144ad4d386b8849069df39887b920ebed 100644 --- a/geom/geocad/src/TGeoToStep.cxx +++ b/geom/geocad/src/TGeoToStep.cxx @@ -37,13 +37,19 @@ CreateGeometry method: ~~~ The resulting STEP file will be saved in the current directory and called -output_geometry.stp and will have converted all the nodes up to and +output_geometry.stp and will have converted all the nodes up to and including level 3. To compile the TGeoCad module on ROOT, OpenCascade must be installed! */ #include "TGeoManager.h" #include "TOCCToStep.h" +// ROOT-9837: the macro `Handle` has been undefined +// we need to redefine it as it is done in the oce +// header Standard_Macro.hxx +#ifndef Handle +#define Handle(ClassName) Handle_##ClassName +#endif #include "TGeoToStep.h" #include "TString.h" #include "TClass.h"