Home | News | Documentation | Download

Macros inside the Macros - #ifndef issue

ROOT Version: 6.22/08
Platform: macosx64
Compiler: Not Provided

I have all the macro files in the same directory and was using them by directly including in the main macro, like:

#include "macro2name.C"

// some other code

(and again - this works)

Now, I want to add #includes in “macro2name.C”, which can be included in “macro1name.C”.
However, I can’t guard double include via #ifndef - I get error…

Here is what I am trying.

In “macro2name.C” file:

#ifndef "macro2name"
#define "macro2name"

#include "macro3name"

// some code

#endif

in “macro1name.C” file

#include "macro2name"
#include "macro3name"

// some code

How Can I Implement #ifndef ?

You need to protect “macro3name”, too:

#ifndef _macro3_included_
#define _macro3_included_
// original contents of macro3name comes here
#endif