# Hiding ROOT::Cintex::Cintex::Enable(); from ROOT6 compilation in a backwards compatible way

**URL:** <https://root-forum.cern.ch/t/hiding-root-enable-from-root6-compilation-in-a-backwards-compatible-way/35134>\
**Category:** Newbie\
**Created:** [July 11, 2019, 9:19pm UTC](https://root-forum.cern.ch/t/hiding-root-enable-from-root6-compilation-in-a-backwards-compatible-way/35134 "2019-07-11T21:19:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![schellman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/d26b3c/32.png) [@schellman](https://root-forum.cern.ch/u/schellman)\
**Post date:** [July 11, 2019, 9:19pm UTC](https://root-forum.cern.ch/t/hiding-root-enable-from-root6-compilation-in-a-backwards-compatible-way/35134/1 "2019-07-11T21:19:24Z")

</div>

I’ve inherited a boatload of ROOT5 code I’d like to make run under both ROOT5 and ROOT6.

It is full of  
ROOT::Cintex::Cintex::Enable();  
and putting macros around that line is getting really old after about 30 times.

Any simple suggestions for overriding that code which crops up everywhere.

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [July 11, 2019, 9:41pm UTC](https://root-forum.cern.ch/t/hiding-root-enable-from-root6-compilation-in-a-backwards-compatible-way/35134/2 "2019-07-11T21:41:39Z")

</div>

Hi,  
how about doing a find/replace of `ROOT::Cintex::Cintex::Enable()` in all files with

```auto
#include <enablecintex.h>
EnableCintex();

```

and then implement `EnableCintex` only once, and putting an `#ifdef` inside the body that makes it no-op for ROOT6?

Or equivalently, implementing

```auto
#if IS_ROOT_6
namespace ROOT {
namespace Cintex {
namespace Cintex {
  void Enable() {}
}
}
}
#endif

```

Cheers,  
Enrico

---

<div class="post-metadata">

**Author:** ![schellman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/d26b3c/32.png) [@schellman](https://root-forum.cern.ch/u/schellman)\
**Post date:** [July 12, 2019, 3:13am UTC](https://root-forum.cern.ch/t/hiding-root-enable-from-root6-compilation-in-a-backwards-compatible-way/35134/3 "2019-07-12T03:13:01Z")

</div>

Thanks that seems to work.

Is IS\_ROOT\_6 a variable I can expect to exist or do I need to set it myself someplace.

but aside from that question I think I can now do much less damage to existing code.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 12, 2019, 6:25am UTC](https://root-forum.cern.ch/t/hiding-root-enable-from-root6-compilation-in-a-backwards-compatible-way/35134/4 "2019-07-12T06:25:42Z")

</div>

Try to “#include” anything from ROOT and then (if ROOT 5 will misbehave, replace `ROOT_VERSION(6,00,00)` with `393216`):

```cpp
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,00)
// ... ROOT 6.00/00 and newer
#else /* ROOT_VERSION_CODE >= ROOT_VERSION(6,00,00) */
// ... ROOT 5 (and older)
#endif /* ROOT_VERSION_CODE >= ROOT_VERSION(6,00,00) */

```

See also:

> [@Legendre polynomials missing, not linking to GSL (Mathmore already installed)](https://root-forum.cern.ch/t/legendre-polynomials-missing-not-linking-to-gsl-mathmore-already-installed/34879/6):
>
> If you run your macros through the standard “root” (or “root.exe”) executable, try to create a “rootlogon.C” file: void rootlogon(void) { // rootlogon.C ... // std::cout \<\< "... rootlogon.C ..." \<\< std::endl; if (gROOT-\>GetVersionCode() \< 393216) { // 393216 = ROOT\_VERSION(6,00,00) gSystem-\>Load("libMathMore"); } } // ... rootlogon.C
