diff --git a/geom/geocad/inc/TGeoToOCC.h b/geom/geocad/inc/TGeoToOCC.h index 474db2df47eceba3e18976cfcbd59d695587745d..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> @@ -60,7 +68,7 @@ public: }; // ROOT-9837 -#if defined(Handle) && !defined(R__Needs_Handle) +#ifdef Handle #undef Handle #endif diff --git a/geom/geocad/inc/TOCCToStep.h b/geom/geocad/inc/TOCCToStep.h index 4786a71e38319f7a324bcc9aff0ff02409937ae3..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> @@ -60,7 +68,7 @@ public: }; // ROOT-9837 -#if defined(Handle) && !defined(R__Needs_Handle) +#ifdef Handle #undef Handle #endif diff --git a/geom/geocad/src/TGeoToOCC.cxx b/geom/geocad/src/TGeoToOCC.cxx index 3ff2099ca163fb4bbfbcd22cbdc7e8ea0e4424bd..10263475c01c5af1b707f9458dc9938c2246a19e 100644 --- a/geom/geocad/src/TGeoToOCC.cxx +++ b/geom/geocad/src/TGeoToOCC.cxx @@ -44,10 +44,13 @@ A log file is created in `/tmp/TGeoCad.log` */ -// Do not #undef Handle: -#define R__Needs_Handle - #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 e3d9c32540993c824b48cf7a43199332364a54c8..2909198144ad4d386b8849069df39887b920ebed 100644 --- a/geom/geocad/src/TGeoToStep.cxx +++ b/geom/geocad/src/TGeoToStep.cxx @@ -42,12 +42,14 @@ including level 3. To compile the TGeoCad module on ROOT, OpenCascade must be installed! */ -// Do not #undef Handle: -#define R__Needs_Handle - #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" diff --git a/geom/geocad/src/TOCCToStep.cxx b/geom/geocad/src/TOCCToStep.cxx index b74b554feefca1087d83b1bb2320ba35dbb3d1f2..1500b12b89aec460625ac6f36f04d02b56d6e665 100644 --- a/geom/geocad/src/TOCCToStep.cxx +++ b/geom/geocad/src/TOCCToStep.cxx @@ -26,10 +26,6 @@ reproduce the ROOT tree that will be written to the STEP file using the OCCWriteStep(const char * fname ) method. */ - -// Do not #undef Handle: -#define R__Needs_Handle - #include "TOCCToStep.h" #include "TGeoToOCC.h"