RE: #pragma link C++ macro ...

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Tue, 01 Mar 2005 10:26:20 -0600


> I thought that the "LinkDef" file was not parsed by the preprocessor (so
> if I define the macro there it should still be visible).

Yes this is true but only in ROOT 4.03/02 and later.

> Anyhow, is there any magic function call that registers a macro?

   G__add_macro("MYMACRO");

> Also the correct syntax is
> #pragma link MACRO XXX;

This above syntax is indeed wrong.
Interestingly enough the right syntax is actually:

   #pragma link C++ global XXX;

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Jacek M. Holeczek
Sent: Tuesday, March 01, 2005 5:00 AM
To: Roottalk
Subject: RE: [ROOT] #pragma link C++ macro ...

Hi,

> > The rootcint is used with the "-p" option ...

> By definition the -p option is preprocessing the file __before__ passing
> them to CINT.
> Hence you can not pass them on.

I thought that the "LinkDef" file was not parsed by the preprocessor (so if I define the macro there it should still be visible).

Anyhow, is there any magic function call that registers a macro? I mean something like :

        G__RegisterUserMacro("XXX", "xxx");

> Also the correct synatx is
> #pragma link MACRO XXX;

According to the :

        http://root.cern.ch/root/Cint.phtml?ref this syntax is reserved for global macro functions or class member macro functions. Actually, the correct syntax is :

        #pragma link MACRO function [[classname]::][fname]<(argtypes)>;

The syntax "#pragma link C++ macro XXX;" is not really described in the "reference manual", but is used in one of the examples there. Search for string "#pragma link C++ MACRO max;" in the above "reference".

Best regards,
Jacek. Received on Tue Mar 01 2005 - 17:36:42 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET