RE:writing universal code

Masaharu Goto (MXJ02154@nifty.ne.jp)
Fri, 9 Jul 1999 22:37:22 +0900


Dear Dariusz Miskowiec,

I'm happy to answer your questions.

>I have a very basic question. (In fact, I nearly expect an answer
>of the kind "Look in the tutorial xxx...") The question is:
>
>How to write code which, without any changes, can be depending
>on the actual need 1) interpreted by root, 2) compiled into a
>shared library and loaded into root, and possibly 3) compiled
>into a stand-alone program?
>
>The include statements that are needed for compilation but
>would be disturbing in the interpreted mode can be surrounded by
>#ifndef __CINT__ and #endif.

At this moment, you need to use #ifndef __CINT__ for this purpose.
Sometime in future, this will not be needed any more. Fons is working
to eliminate needs for #ifndef __CINT__.

>Fine. But how about the ClassDef
>statement? It is needed for rootcint but disturbing in the
>interpreter mode, and it seems that the variable __CINT__ is
>set in both these situations.

There is another macro __MAKECINT__ which is only defined in
rootcint, but not in interpreter mode.

I hope this information helps

Thank you
Masaharu Goto