__CINT__ and __MAKECINT__

Hello,

There is something I do not understand about CINT and MAKECINT. Here is a simple macro I used for tests:

#include <iostream>

using std::cout;

/******************************************************************************/
void test__CINT__(void)
{

 #ifdef __CINT__
 cout<<"__CINT__\n";
 #else
 cout<<"NO __CINT__\n";
 #endif

 #ifdef __MAKECINT__
 cout<<"__MAKECINT__\n";
 #else
 cout<<"NO __MAKECINT__\n";
 #endif

}// end of function
/******************************************************************************/

And here is the output:

So it looks like MAKECINT is never defined and CINT is only defined in interpreter, which is not what is written in the User’s Guide.

Basically my question is which statement should I use to separate the following two cases:

  1. Code visible ONLY to root for compiled scripts.
  2. Code visible only when one compiles code using gcc (no ROOT involved).

How do I do that?

Thank you,
Siarhei.

MAKECINT is define only during the dictionary generation phase (aka rootcint). rootcint never looks into the implementation and hence MAKECINT only makes senses around declaration outside function implementation.

Philippe

Hi,
as you already found out, CINT is defined when interpreting code. MAKECINT is defined when running rootcint, i.e. when generating dictionaries.

You already found out: use CINT.

You can use #ifdef ROOT_VERSION

Cheers, Axel.